xuzifu666 commented on code in PR #4258:
URL: https://github.com/apache/calcite/pull/4258#discussion_r2008980075
##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -636,13 +636,21 @@ private static String toSql(RelNode root, SqlDialect
dialect,
sql(query).ok(expected);
}
- @Test void testSelectQueryWithHiveCube() {
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6906">[CALCITE-6906]
+ * Support ClickHouse Dialect with cube with syntax</a>. */
+ @Test void testSelectQueryWithCube() {
String query = "select \"product_class_id\", \"product_id\", count(*) "
+ "from \"product\" group by cube(\"product_class_id\",
\"product_id\")";
String expected = "SELECT `product_class_id`, `product_id`, COUNT(*)\n"
+ "FROM `foodmart`.`product`\n"
+ "GROUP BY `product_class_id`, `product_id` WITH CUBE";
- sql(query).withHive().ok(expected);
+ String expectedClickHouse = "SELECT `product_class_id`, `product_id`,
COUNT(*)\n"
Review Comment:
In doc description the same query also can be written using WITH keyword.
like:SELECT year, month, day, count(*) FROM t GROUP BY year, month, day WITH
CUBE;
and I also test about it,the result is
expected. @mihaibudiu
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]