-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support GROUPING SETS #33631
Support GROUPING SETS #33631
Conversation
…ter grouping sets
2. Update formatAST to support grouping sets query with distributed table 3. modify astExpression to support function in grouping sets
if (frame.surround_each_list_element_with_parens) | ||
settings.ostr << "("; | ||
|
||
FormatStateStacked frame_nested = frame; | ||
frame_nested.surround_each_list_element_with_parens = false; | ||
(*it)->formatImpl(settings, state, frame_nested); | ||
|
||
if (frame.surround_each_list_element_with_parens) | ||
settings.ostr << ")"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, I have an extra space while formatting in client:
ELECT
SUM(number) AS sum_value,
count() AS count_value
FROM numbers_mt(1000000)
GROUP BY
GROUPING SETS (
( number % 10),
^ here
( number % 100))
^ here
ORDER BY
sum_value ASC,
count_value ASC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fixed in #32999
Compare result for
and
The key (0, 0) was squashed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally everything is ok.
Except it would be good to fix key squashing for the distributed case :)
And fix execution of the query with only one grouping set
@Mergifyio update |
✅ Branch has been successfully updated |
ok, failed tests does not seem to be relevant to the PR, merging. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add support of GROUPING SETS in GROUP BY clause. Follow up after #33186. This implementation supports a parallel processing of grouping sets.