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 2019/11/28 04:30:44 UTC

[GitHub] [calcite] weidong3630 commented on a change in pull request #1606: [CALCITE-3466] Do not drop the "group by" clause of subquery in a select statement with "group by" clause in JDBC adapter.

weidong3630 commented on a change in pull request #1606: [CALCITE-3466] Do not drop the "group by" clause of subquery in a select statement with "group by" clause in JDBC adapter.
URL: https://github.com/apache/calcite/pull/1606#discussion_r351588679
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java
 ##########
 @@ -321,6 +321,20 @@ private static String toSql(RelNode root, SqlDialect dialect) {
         .ok(expectedMySql);
   }
 
+  @Test public void testSelectQueryWithGroupBySubQuery() {
+    String query = "select \"product_class_id\", count(\"product_id\")\n"
+        + "from (select \"product_class_id\", \"product_id\"\n"
+        + "from \"product\"\n"
+        + "group by \"product_class_id\", \"product_id\") as t\n"
+        + "group by \"product_class_id\"";
+    final String expected = "SELECT \"product_class_id\", COUNT(*)\n"
 
 Review comment:
   It's indeed another bug, I will make another issue to discuss it.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services