Return-Path: X-Original-To: apmail-drill-commits-archive@www.apache.org Delivered-To: apmail-drill-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 680141870A for ; Fri, 19 Jun 2015 00:26:00 +0000 (UTC) Received: (qmail 8989 invoked by uid 500); 19 Jun 2015 00:26:00 -0000 Delivered-To: apmail-drill-commits-archive@drill.apache.org Received: (qmail 8956 invoked by uid 500); 19 Jun 2015 00:26:00 -0000 Mailing-List: contact commits-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: commits@drill.apache.org Delivered-To: mailing list commits@drill.apache.org Received: (qmail 8946 invoked by uid 99); 19 Jun 2015 00:26:00 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jun 2015 00:26:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2AD08E3CA6; Fri, 19 Jun 2015 00:26:00 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jni@apache.org To: commits@drill.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) 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 Authored: Mon Jun 15 14:00:12 2015 -0700 Committer: Jinfeng Ni 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 @@ org.apache.calcite calcite-core - 1.1.0-drill-r7 + 1.1.0-drill-r8 org.jgrapht