You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by mm...@apache.org on 2018/06/15 11:16:51 UTC
calcite git commit: Add tests for [CALCITE-1436]
Repository: calcite
Updated Branches:
refs/heads/master 9beabf852 -> 834ad98e7
Add tests for [CALCITE-1436]
Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/834ad98e
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/834ad98e
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/834ad98e
Branch: refs/heads/master
Commit: 834ad98e714f6df435b171cd898fb70f9bdb0b04
Parents: 9beabf8
Author: Michael Mior <mm...@uwaterloo.ca>
Authored: Thu Jun 14 23:43:04 2018 -0400
Committer: Michael Mior <mm...@uwaterloo.ca>
Committed: Thu Jun 14 23:43:04 2018 -0400
----------------------------------------------------------------------
.../apache/calcite/test/InterpreterTest.java | 28 +++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/calcite/blob/834ad98e/core/src/test/java/org/apache/calcite/test/InterpreterTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/calcite/test/InterpreterTest.java b/core/src/test/java/org/apache/calcite/test/InterpreterTest.java
index d35c5c8..9e419fd 100644
--- a/core/src/test/java/org/apache/calcite/test/InterpreterTest.java
+++ b/core/src/test/java/org/apache/calcite/test/InterpreterTest.java
@@ -176,7 +176,7 @@ public class InterpreterTest {
"[6, George]");
}
- @Test public void testAggregate() throws Exception {
+ @Test public void testAggregateCount() throws Exception {
rootSchema.add("beatles", new ScannableTableTest.BeatlesTable());
SqlNode parse =
planner.parse("select count(*) from \"beatles\"");
@@ -189,6 +189,32 @@ public class InterpreterTest {
"[4]");
}
+ @Test public void testAggregateMax() throws Exception {
+ rootSchema.add("beatles", new ScannableTableTest.BeatlesTable());
+ SqlNode parse =
+ planner.parse("select max(\"i\") from \"beatles\"");
+
+ SqlNode validate = planner.validate(parse);
+ RelNode convert = planner.rel(validate).rel;
+
+ final Interpreter interpreter = new Interpreter(dataContext, convert);
+ assertRows(interpreter,
+ "[6]");
+ }
+
+ @Test public void testAggregateMin() throws Exception {
+ rootSchema.add("beatles", new ScannableTableTest.BeatlesTable());
+ SqlNode parse =
+ planner.parse("select min(\"i\") from \"beatles\"");
+
+ SqlNode validate = planner.validate(parse);
+ RelNode convert = planner.rel(validate).rel;
+
+ final Interpreter interpreter = new Interpreter(dataContext, convert);
+ assertRows(interpreter,
+ "[4]");
+ }
+
@Test public void testAggregateGroup() throws Exception {
rootSchema.add("beatles", new ScannableTableTest.BeatlesTable());
SqlNode parse =