Repository: drill Updated Branches: refs/heads/master dbd8925a4 -> e923ac54d
DRILL-3344: Bump Drill-Calcite version to 1.1.0-drill-r13; Added unit tests Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/fdfb1b26 Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/fdfb1b26 Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/fdfb1b26 Branch: refs/heads/master Commit: fdfb1b26c42e90bb07eb74f687b4a7328e750edb Parents: dbd8925 Author: Hsuan-Yi Chu <[email protected]> Authored: Mon Jun 29 10:33:16 2015 -0700 Committer: Aman Sinha <[email protected]> Committed: Mon Jun 29 14:05:06 2015 -0700 ---------------------------------------------------------------------- .../java/org/apache/drill/BaseTestQuery.java | 11 +++++++++ .../apache/drill/exec/TestWindowFunctions.java | 26 ++++++++++++++++++++ pom.xml | 2 +- 3 files changed, 38 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/fdfb1b26/exec/java-exec/src/test/java/org/apache/drill/BaseTestQuery.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/test/java/org/apache/drill/BaseTestQuery.java b/exec/java-exec/src/test/java/org/apache/drill/BaseTestQuery.java index 46186df..d428920 100644 --- a/exec/java-exec/src/test/java/org/apache/drill/BaseTestQuery.java +++ b/exec/java-exec/src/test/java/org/apache/drill/BaseTestQuery.java @@ -35,6 +35,7 @@ import org.apache.drill.exec.client.DrillClient; import org.apache.drill.exec.exception.SchemaChangeException; import org.apache.drill.exec.memory.BufferAllocator; import org.apache.drill.exec.memory.TopLevelAllocator; +import org.apache.drill.exec.proto.UserBitShared; import org.apache.drill.exec.proto.UserBitShared.QueryId; import org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState; import org.apache.drill.exec.proto.UserBitShared.QueryType; @@ -354,6 +355,16 @@ public class BaseTestQuery extends ExecTest { assertThat(expException.getMessage(), containsString(expectedErrorMsg)); } + /** + * Utility method which tests given query produces a {@link UserException} + * with {@link org.apache.drill.exec.proto.UserBitShared.DrillPBError.ErrorType} being DrillPBError.ErrorType.PARSE + * the given message. + * @param testSqlQuery Test query + */ + protected static void parseErrorHelper(final String testSqlQuery) throws Exception { + errorMsgTestHelper(testSqlQuery, UserBitShared.DrillPBError.ErrorType.PARSE.name()); + } + public static String getFile(String resource) throws IOException{ URL url = Resources.getResource(resource); if (url == null) { http://git-wip-us.apache.org/repos/asf/drill/blob/fdfb1b26/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 7f75771..24c1f4c 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 @@ -225,6 +225,32 @@ public class TestWindowFunctions extends BaseTestQuery { } } + @Test // DRILL-3344 + public void testWindowGroupBy() throws Exception { + String query = "explain plan for SELECT max(n_nationkey) OVER (), n_name as col2 \n" + + "from cp.`tpch/nation.parquet` \n" + + "group by n_name"; + + parseErrorHelper(query); + } + + @Test // DRILL-3346 + public void testWindowGroupByOnView() throws Exception { + try { + String createView = "create view testWindowGroupByOnView(a, b) as \n" + + "select n_nationkey, n_name from cp.`tpch/nation.parquet`"; + String query = "explain plan for SELECT max(a) OVER (), b as col2 \n" + + "from testWindowGroupByOnView \n" + + "group by b"; + + test("use dfs_test.tmp"); + test(createView); + parseErrorHelper(query); + } finally { + test("drop view testWindowGroupByOnView"); + } + } + @Test // DRILL-3188 public void testWindowFrameEquivalentToDefault() throws Exception { final String query1 = "explain plan for select sum(n_nationKey) over(partition by n_nationKey order by n_nationKey) \n" + http://git-wip-us.apache.org/repos/asf/drill/blob/fdfb1b26/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index ba7047f..9d40d09 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-r12</version> + <version>1.1.0-drill-r13</version> <exclusions> <exclusion> <groupId>org.jgrapht</groupId>
