You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by jn...@apache.org on 2015/09/24 02:10:34 UTC

drill git commit: DRILL-3781: Group by system function in schema-based table.

Repository: drill
Updated Branches:
  refs/heads/master 942d3525b -> d2caa62e1


DRILL-3781:  Group by system function in schema-based table.

Fix is in Calcite-886. Add unit test and bump forked Calcite version in Drill.


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

Branch: refs/heads/master
Commit: d2caa62e1074ee99ceb764443496097f578d6d2a
Parents: 942d352
Author: Jinfeng Ni <jn...@apache.org>
Authored: Mon Sep 21 14:59:03 2015 -0700
Committer: Jinfeng Ni <jn...@apache.org>
Committed: Wed Sep 23 16:03:56 2015 -0700

----------------------------------------------------------------------
 .../exec/fn/impl/TestAggregateFunctions.java    | 38 ++++++++++++++++++++
 pom.xml                                         |  2 +-
 2 files changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/d2caa62e/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java b/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java
index c02fc05..36c40d5 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestAggregateFunctions.java
@@ -400,4 +400,42 @@ public class TestAggregateFunctions extends BaseTestQuery {
 
   }
 
+  @Test // DRILL-3781
+  // GROUP BY System functions in schema table.
+  public void testGroupBySystemFuncSchemaTable() throws Exception {
+    final String query = "select count(*) as cnt from sys.version group by CURRENT_DATE";
+    final String[] expectedPlan = {"(?s)(StreamAgg|HashAgg)"};
+    final String[] excludedPatterns = {};
+
+    PlanTestBase.testPlanMatchingPatterns(query, expectedPlan, excludedPatterns);
+  }
+
+  @Test //DRILL-3781
+  // GROUP BY System functions in csv, parquet, json table.
+  public void testGroupBySystemFuncFileSystemTable() throws Exception {
+    final String query = String.format("select count(*) as cnt from dfs_test.`%s/nation/nation.tbl` group by CURRENT_DATE", TEST_RES_PATH);
+    testBuilder()
+        .sqlQuery(query)
+        .unOrdered()
+        .baselineColumns("cnt")
+        .baselineValues(25l)
+        .build().run();
+
+    final String query2 = "select count(*) as cnt from cp.`tpch/nation.parquet` group by CURRENT_DATE";
+    testBuilder()
+        .sqlQuery(query2)
+        .unOrdered()
+        .baselineColumns("cnt")
+        .baselineValues(25l)
+        .build().run();
+
+    final String query3 = "select count(*) as cnt from cp.`employee.json` group by CURRENT_DATE";
+    testBuilder()
+        .sqlQuery(query3)
+        .unOrdered()
+        .baselineColumns("cnt")
+        .baselineValues(1155l)
+        .build().run();
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/d2caa62e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 93f423a..8b59e43 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1227,7 +1227,7 @@
           <dependency>
             <groupId>org.apache.calcite</groupId>
             <artifactId>calcite-core</artifactId>
-            <version>1.4.0-drill-r2</version>
+            <version>1.4.0-drill-r5</version>
             <exclusions>
               <exclusion>
                 <groupId>org.jgrapht</groupId>