drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject drill git commit: DRILL-3204, DRILL-3296: Upgrade Drill-Calcite to 1.1.0-drill-r8; Add test cases
Date Fri, 19 Jun 2015 00:26:00 GMT
Repository: drill
Updated Branches:
  refs/heads/master f0bc2e70f -> 49b6dba5a


DRILL-3204, DRILL-3296: Upgrade Drill-Calcite to 1.1.0-drill-r8; Add test cases


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

Branch: refs/heads/master
Commit: 49b6dba5a914f367bc22a0797f1bf4e2ce587b83
Parents: f0bc2e7
Author: Hsuan-Yi Chu <hsuanyi@usc.edu>
Authored: Mon Jun 15 14:00:12 2015 -0700
Committer: Jinfeng Ni <jni@apache.org>
Committed: Thu Jun 18 17:24:13 2015 -0700

----------------------------------------------------------------------
 .../org/apache/drill/TestUnionDistinct.java     | 25 ++++++++++++++++++++
 .../apache/drill/exec/TestWindowFunctions.java  | 10 ++++++++
 .../unionDistinct/testGroupByUnionDistinct.tsv  | 25 ++++++++++++++++++++
 pom.xml                                         |  2 +-
 4 files changed, 61 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/49b6dba5/exec/java-exec/src/test/java/org/apache/drill/TestUnionDistinct.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestUnionDistinct.java b/exec/java-exec/src/test/java/org/apache/drill/TestUnionDistinct.java
index d252459..add9787 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestUnionDistinct.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestUnionDistinct.java
@@ -680,4 +680,29 @@ public class TestUnionDistinct extends BaseTestQuery {
         .build()
         .run();
   }
+
+  @Test // DRILL-3296
+  public void testGroupByUnionDistinct() throws Exception {
+    String query = "select n_nationkey from \n" +
+        "(select n_nationkey from cp.`tpch/nation.parquet` \n" +
+        "union select n_nationkey from cp.`tpch/nation.parquet`) \n" +
+        "group by n_nationkey";
+
+
+    // Validate the plan
+    final String[] expectedPlan = {"HashAgg.*\n" +
+        ".*UnionAll"};
+    final String[] excludedPlan = {"HashAgg.*\n.*HashAgg"};
+    PlanTestBase.testPlanMatchingPatterns(query, expectedPlan, excludedPlan);
+
+    // Validate the result
+    testBuilder()
+        .sqlQuery(query)
+        .unOrdered()
+        .csvBaselineFile("testframework/unionDistinct/testGroupByUnionDistinct.tsv")
+        .baselineTypes(TypeProtos.MinorType.INT)
+        .baselineColumns("n_nationkey")
+        .build()
+        .run();
+  }
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/49b6dba5/exec/java-exec/src/test/java/org/apache/drill/exec/TestWindowFunctions.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/TestWindowFunctions.java b/exec/java-exec/src/test/java/org/apache/drill/exec/TestWindowFunctions.java
index 2ec2481..dc34632 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/TestWindowFunctions.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/TestWindowFunctions.java
@@ -213,4 +213,14 @@ public class TestWindowFunctions extends BaseTestQuery {
     test(query2);
     test(query3);
   }
+
+  @Test // DRILL-3204
+  public void testWindowWithJoin() throws Exception {
+    final String query = "select sum(t1.r_regionKey) over(partition by t1.r_regionKey)  \n"
+
+        "from cp.`tpch/region.parquet` t1, cp.`tpch/nation.parquet` t2 \n" +
+        "where t1.r_regionKey = t2.n_nationKey \n" +
+        "group by t1.r_regionKey";
+
+    test(query);
+  }
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/49b6dba5/exec/java-exec/src/test/resources/testframework/unionDistinct/testGroupByUnionDistinct.tsv
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/resources/testframework/unionDistinct/testGroupByUnionDistinct.tsv
b/exec/java-exec/src/test/resources/testframework/unionDistinct/testGroupByUnionDistinct.tsv
new file mode 100644
index 0000000..521485b
--- /dev/null
+++ b/exec/java-exec/src/test/resources/testframework/unionDistinct/testGroupByUnionDistinct.tsv
@@ -0,0 +1,25 @@
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/drill/blob/49b6dba5/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 675a6e0..df75c80 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1226,7 +1226,7 @@
           <dependency>
             <groupId>org.apache.calcite</groupId>
             <artifactId>calcite-core</artifactId>
-            <version>1.1.0-drill-r7</version>
+            <version>1.1.0-drill-r8</version>
             <exclusions>
               <exclusion>
                 <groupId>org.jgrapht</groupId>


Mime
View raw message