Repository: drill Updated Branches: refs/heads/master fdb6b4fec -> b525692e0
DRILL-3580: Add test case and bump calcite version to 1.4.0-drill-r2 Fix is in CALCITE-841 Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/9a313933 Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/9a313933 Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/9a313933 Branch: refs/heads/master Commit: 9a313933074ee95f53c15a511c41524f723c0ccf Parents: fdb6b4f Author: Hsuan-Yi Chu <[email protected]> Authored: Tue Sep 8 10:42:51 2015 -0700 Committer: Jinfeng Ni <[email protected]> Committed: Thu Sep 10 17:45:06 2015 -0700 ---------------------------------------------------------------------- .../apache/drill/exec/TestWindowFunctions.java | 28 ++++++++++++++++++++ pom.xml | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/9a313933/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 29b702c..dbbc777 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 @@ -450,4 +450,32 @@ public class TestWindowFunctions extends BaseTestQuery { .build() .run(); } + + @Test // DRILL-3580 + public void testExpressionInWindowFunction() throws Exception { + String root = FileUtils.getResourceAsFile("/store/text/data/t.json").toURI().toString(); + String query = String.format("select a1, b1, sum(b1) over (partition by a1) as c1, sum(a1 + b1) over (partition by a1) as c2\n" + + "from dfs_test.`%s`", root); + + // Validate the plan + final String[] expectedPlan = {"Window\\(window#0=\\[window\\(partition \\{0\\} order by \\[\\].*\\[SUM\\(\\$1\\), SUM\\(\\$2\\)\\]"}; + PlanTestBase.testPlanMatchingPatterns(query, expectedPlan, new String[]{}); + + testBuilder() + .sqlQuery(query) + .unOrdered() + .baselineColumns("a1", "b1", "c1", "c2") + .baselineValues(0l, 1l, 8l, 8l) + .baselineValues(0l, 1l, 8l, 8l) + .baselineValues(0l, 2l, 8l, 8l) + .baselineValues(0l, 2l, 8l, 8l) + .baselineValues(0l, 2l, 8l, 8l) + .baselineValues(10l, 3l, 21l, 71l) + .baselineValues(10l, 3l, 21l, 71l) + .baselineValues(10l, 5l, 21l, 71l) + .baselineValues(10l, 5l, 21l, 71l) + .baselineValues(10l, 5l, 21l, 71l) + .build() + .run(); + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/drill/blob/9a313933/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 8d4b318..c17e612 100644 --- a/pom.xml +++ b/pom.xml @@ -1226,7 +1226,7 @@ <dependency> <groupId>org.apache.calcite</groupId> <artifactId>calcite-core</artifactId> - <version>1.4.0-drill-r0</version> + <version>1.4.0-drill-r2</version> <exclusions> <exclusion> <groupId>org.jgrapht</groupId>
