Skip to content

[CALCITE-6906] Support ClickHouse Dialect with cube with syntax#4258

Closed
xuzifu666 wants to merge 1 commit intoapache:mainfrom
xuzifu666:ck_cube_with
Closed

[CALCITE-6906] Support ClickHouse Dialect with cube with syntax#4258
xuzifu666 wants to merge 1 commit intoapache:mainfrom
xuzifu666:ck_cube_with

Conversation

@xuzifu666
Copy link
Member

+ "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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@xuzifu666 xuzifu666 Mar 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this PR needed if the other syntax is correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

@xuzifu666 xuzifu666 Mar 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I know thanks for your reminder, here maybe not need to change.@mihaibudiu I close the pr firstly.

@xuzifu666 xuzifu666 closed this Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants