carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kunalkap...@apache.org
Subject [1/2] carbondata git commit: [HOTFIX][PR 2575] Fixed modular plan creation only if valid datamaps are available
Date Thu, 02 Aug 2018 11:23:28 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master b483a5746 -> b65bf9bc7


[HOTFIX][PR 2575] Fixed modular plan creation only if valid datamaps are available

update query is failing in spark-2.2 cluster if mv jars are available because catalogs
are not empty if datamap are created for other table also and returns true from isValidPlan()
inside MVAnalyzerRule.

This closes #2579


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/f52c1338
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/f52c1338
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/f52c1338

Branch: refs/heads/master
Commit: f52c13380828ac7f388273cb2460971fc1a5eed1
Parents: b483a57
Author: rahul <rahul.kumar@knoldus.in>
Authored: Mon Jul 30 12:01:49 2018 +0530
Committer: kunal642 <kunalkapoor642@gmail.com>
Committed: Thu Aug 2 16:46:16 2018 +0530

----------------------------------------------------------------------
 .../carbondata/mv/rewrite/MVCreateTestCase.scala      | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/f52c1338/datamap/mv/core/src/test/scala/org/apache/carbondata/mv/rewrite/MVCreateTestCase.scala
----------------------------------------------------------------------
diff --git a/datamap/mv/core/src/test/scala/org/apache/carbondata/mv/rewrite/MVCreateTestCase.scala
b/datamap/mv/core/src/test/scala/org/apache/carbondata/mv/rewrite/MVCreateTestCase.scala
index 6adb14e..0b96202 100644
--- a/datamap/mv/core/src/test/scala/org/apache/carbondata/mv/rewrite/MVCreateTestCase.scala
+++ b/datamap/mv/core/src/test/scala/org/apache/carbondata/mv/rewrite/MVCreateTestCase.scala
@@ -18,6 +18,7 @@ package org.apache.carbondata.mv.rewrite
 
 import java.io.File
 
+import org.apache.spark.sql.Row
 import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
 import org.apache.spark.sql.execution.datasources.LogicalRelation
 import org.apache.spark.sql.test.util.QueryTest
@@ -885,6 +886,19 @@ class MVCreateTestCase extends QueryTest with BeforeAndAfterAll {
     sql("drop datamap if exists datamap_subqry")
   }
 
+  test("basic scenario") {
+
+    sql("drop table if exists mvtable1")
+    sql("create table mvtable1(name string,age int,salary int) stored by 'carbondata'")
+    sql(" insert into mvtable1 select 'n1',12,12")
+    sql("  insert into mvtable1 select 'n1',12,12")
+    sql(" insert into mvtable1 select 'n3',12,12")
+    sql(" insert into mvtable1 select 'n4',12,12")
+    sql("update mvtable1 set(name) = ('updatedName')").show()
+    checkAnswer(sql("select count(*) from mvtable1 where name = 'updatedName'"),Seq(Row(4)))
+    sql("drop table if exists mvtable1")
+  }
+
   def verifyMVDataMap(logicalPlan: LogicalPlan, dataMapName: String): Boolean = {
     val tables = logicalPlan collect {
       case l: LogicalRelation => l.catalogTable.get


Mime
View raw message