calcite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject [2/2] incubator-calcite git commit: [CALCITE-822] Add a unit test case to test collation of LogicalAggregate
Date Sat, 08 Aug 2015 15:21:54 GMT
[CALCITE-822] Add a unit test case to test collation of LogicalAggregate

Close apache/incubator-calcite#118


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

Branch: refs/heads/master
Commit: e827bf0a2e410e5613dcf407778e4f5735e75c1c
Parents: ac934f6
Author: Jinfeng Ni <jni@apache.org>
Authored: Fri Aug 7 09:28:22 2015 -0700
Committer: Julian Hyde <jhyde@apache.org>
Committed: Fri Aug 7 18:43:53 2015 -0700

----------------------------------------------------------------------
 core/src/test/resources/sql/agg.oq | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/e827bf0a/core/src/test/resources/sql/agg.oq
----------------------------------------------------------------------
diff --git a/core/src/test/resources/sql/agg.oq b/core/src/test/resources/sql/agg.oq
index 771ff86..2fe0cc2 100644
--- a/core/src/test/resources/sql/agg.oq
+++ b/core/src/test/resources/sql/agg.oq
@@ -1092,6 +1092,34 @@ group by m.empno;
 
 !ok
 
+# Collation of LogicalAggregate ([CALCITE-783] and [CALCITE-822])
+select  sum(x) as sum_cnt,
+  count(distinct y) as cnt_dist
+from
+  (
+  select
+    count(*)                as x,
+          t1.job      as y,
+    t1.deptno as z
+  from
+    "scott".emp t1
+  group by t1.job, t1.deptno
+  order by t1.job, t1.deptno
+) sq(x,y,z)
+group by z
+order by sum_cnt;
+
++---------+----------+
+| SUM_CNT | CNT_DIST |
++---------+----------+
+|       3 |        3 |
+|       5 |        3 |
+|       6 |        3 |
++---------+----------+
+(3 rows)
+
+!ok
+
 # [CALCITE-729] IndexOutOfBoundsException in ROLLUP query on JDBC data source
 !use jdbc_scott
 select deptno, job, count(*) as c


Mime
View raw message