[CALCITE-6906] Support ClickHouse Dialect with cube with syntax#4258
[CALCITE-6906] Support ClickHouse Dialect with cube with syntax#4258xuzifu666 wants to merge 1 commit intoapache:mainfrom
Conversation
| + "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" |
There was a problem hiding this comment.
This does not seem to match the docs of clickhouse: https://clickhouse.com/docs/sql-reference/statements/select/group-by#cube-modifier
There was a problem hiding this 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
There was a problem hiding this comment.
Why is this PR needed if the other syntax is correct?
There was a problem hiding this comment.
IMO if user migrate other SQL system which support with
cube syntax to clickhouse, in this condition they not need to change SQL, if clickhouse self supprt the syntax maybe better.
There was a problem hiding this comment.
OK, I know thanks for your reminder, here maybe not need to change.@mihaibudiu I close the pr firstly.
As description in JIRA: https://issues.apache.org/jira/browse/CALCITE-6906