Repository: incubator-carbondata
Updated Branches:
  refs/heads/master 20453497b -> fe36dea66


fixUnionTestCase


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

Branch: refs/heads/master
Commit: b0d3d403f1ba345de6cc49dc335778ffa150d375
Parents: 2045349
Author: QiangCai <qiang...@qq.com>
Authored: Wed Jan 11 23:47:25 2017 +0800
Committer: jackylk <jacky.li...@huawei.com>
Committed: Thu Jan 12 20:11:32 2017 +0800

----------------------------------------------------------------------
 .../AllDataTypesTestCaseAggregate.scala         | 30 ++++++++++----------
 .../AllDataTypesTestCaseAggregate.scala         | 17 -----------
 .../sql/optimizer/CarbonLateDecodeRule.scala    |  2 +-
 3 files changed, 16 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/b0d3d403/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
----------------------------------------------------------------------
diff --git 
a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
 
b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
index a0f12f5..d17a946 100644
--- 
a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
+++ 
b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
@@ -1087,21 +1087,21 @@ class AllDataTypesTestCaseAggregate extends QueryTest 
with BeforeAndAfterAll {
       Seq(Row(96981.54360516652)))
   })
 
-//  test("CARBONDATA-60-union-defect")({
-//    sql("drop table if exists carbonunion")
-//    import sqlContext.implicits._
-//    val df = sqlContext.sparkContext.parallelize(1 to 1000).map(x => (x+"", 
(x+100)+"")).toDF("c1", "c2")
-//    df.registerTempTable("sparkunion")
-//    df.write
-//      .format("carbondata")
-//      .mode(SaveMode.Overwrite)
-//      .option("tableName", "carbonunion")
-//      .save()
-//    checkAnswer(
-//      sql("select c1,count(c1) from (select c1 as c1,c2 as c2 from 
carbonunion union all select c2 as c1,c1 as c2 from carbonunion)t where 
c1='200' group by c1"),
-//      sql("select c1,count(c1) from (select c1 as c1,c2 as c2 from 
sparkunion union all select c2 as c1,c1 as c2 from sparkunion)t where c1='200' 
group by c1"))
-//    sql("drop table if exists carbonunion")
-//  })
+  test("CARBONDATA-60-union-defect")({
+    sql("drop table if exists carbonunion")
+    import sqlContext.implicits._
+    val df = sqlContext.sparkContext.parallelize(1 to 1000).map(x => (x+"", 
(x+100)+"")).toDF("c1", "c2")
+    df.registerTempTable("sparkunion")
+    df.write
+      .format("carbondata")
+      .mode(SaveMode.Overwrite)
+      .option("tableName", "carbonunion")
+      .save()
+    checkAnswer(
+      sql("select c1,count(c1) from (select c1 as c1,c2 as c2 from carbonunion 
union all select c2 as c1,c1 as c2 from carbonunion)t where c1='200' group by 
c1"),
+      sql("select c1,count(c1) from (select c1 as c1,c2 as c2 from sparkunion 
union all select c2 as c1,c1 as c2 from sparkunion)t where c1='200' group by 
c1"))
+    sql("drop table if exists carbonunion")
+  })
 
   test("select Min(imei) from (select imei from Carbon_automation_test order 
by imei) t")({
     checkAnswer(

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/b0d3d403/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
----------------------------------------------------------------------
diff --git 
a/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
 
b/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
index 3c52949..1629faf 100644
--- 
a/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
+++ 
b/integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/AllDataTypesTestCaseAggregate.scala
@@ -59,21 +59,4 @@ class AllDataTypesTestCaseAggregate extends QueryTest with 
BeforeAndAfterAll {
       Seq(Row(100005.8)))
   })
 
-  test("CARBONDATA-60-union-defect")({
-    sql("drop table if exists carbonunion")
-    import sqlContext.implicits._
-    val df = sqlContext.sparkContext.parallelize(1 to 1000).map(x => (x+"", 
(x+100)+"")).toDF("c1", "c2")
-    df.registerTempTable("sparkunion")
-    df.write
-      .format("carbondata")
-      .mode(SaveMode.Overwrite)
-      .option("tableName", "carbonunion")
-      .save()
-    checkAnswer(
-      sql("select c1,count(c1) from (select c1 as c1,c2 as c2 from carbonunion 
union all select c2 as c1,c1 as c2 from carbonunion)t where c1='200' group by 
c1"),
-      sql("select c1,count(c1) from (select c1 as c1,c2 as c2 from sparkunion 
union all select c2 as c1,c1 as c2 from sparkunion)t where c1='200' group by 
c1"))
-    sql("drop table if exists carbonunion")
-    sql("drop table if exists sparkunion")
-  })
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/b0d3d403/integration/spark2/src/main/scala/org/apache/spark/sql/optimizer/CarbonLateDecodeRule.scala
----------------------------------------------------------------------
diff --git 
a/integration/spark2/src/main/scala/org/apache/spark/sql/optimizer/CarbonLateDecodeRule.scala
 
b/integration/spark2/src/main/scala/org/apache/spark/sql/optimizer/CarbonLateDecodeRule.scala
index 463faf1..52c0eb0 100644
--- 
a/integration/spark2/src/main/scala/org/apache/spark/sql/optimizer/CarbonLateDecodeRule.scala
+++ 
b/integration/spark2/src/main/scala/org/apache/spark/sql/optimizer/CarbonLateDecodeRule.scala
@@ -173,7 +173,7 @@ class CarbonLateDecodeRule extends Rule[LogicalPlan] with 
PredicateHelper {
               !child.isInstanceOf[CarbonDictionaryCatalystDecoder]) {
               CarbonDictionaryTempDecoder(condAttrs,
                 new util.HashSet[AttributeReferenceWrapper](),
-                union.children.head)
+                child)
             } else {
               child
             }

Reply via email to