You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2022/05/15 13:42:10 UTC

[GitHub] [calcite] hannerwang commented on a diff in pull request #2771: [CALCITE-5089] Allow GROUP BY ALL or DISTINCT set quantifier on GROUPING SETS

hannerwang commented on code in PR #2771:
URL: https://github.com/apache/calcite/pull/2771#discussion_r873171723


##########
testkit/src/main/java/org/apache/calcite/sql/parser/SqlParserTest.java:
##########
@@ -2122,6 +2122,29 @@ void checkPeriodPredicate(Checker checker) {
     sql(sql).ok(expected);
   }
 
+  @Test void testGroupByAllOrDistinct() {
+    final String sql = "select deptno from emp\n"
+        + "group by all cube (a, b), rollup (a, b)";
+    final String expected = "SELECT `DEPTNO`\n"
+        + "FROM `EMP`\n"
+        + "GROUP BY CUBE(`A`, `B`), ROLLUP(`A`, `B`)";
+    sql(sql).ok(expected);
+
+    final String sql1 = "select deptno from emp\n"
+        + "group by distinct cube (a, b), rollup (a, b)";
+    final String expected1 = "SELECT `DEPTNO`\n"

Review Comment:
   Hi @chunweilei , I find the other tests have no this kind of edge cases, and do you mean `GROUP BY DISTINCT ()` ast should be unparsed as `GROUP BY ()`? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org