Group By All - #7622
Merged
Merged
Conversation
alamb
reviewed
Sep 22, 2023
| } else { | ||
| // 'group by all' groups wrt. all select expressions except 'AggregateFunction's. | ||
| // Filter and collect non-aggregate select expressions | ||
| select_exprs |
Contributor
There was a problem hiding this comment.
👍 very nice explanation and code
alamb
approved these changes
Sep 22, 2023
alamb
left a comment
Contributor
There was a problem hiding this comment.
LGTM -- thank you @berkaysynnada
Contributor
|
I think this is a pretty small code change so I am just going to merge it in. Thanks again @berkaysynnada |
Ted-Jiang
pushed a commit
to Ted-Jiang/arrow-datafusion
that referenced
this pull request
Oct 7, 2023
* group by all is resolved * restore the removed tests * tests extended * fix after merge
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #.
Closes #7619
Rationale for this change
There exists a GROUP BY usage with ALL keyword in some platforms (https://docs.snowflake.com/en/sql-reference/constructs/group-by#label-group-by-all-columns, https://duckdb.org/docs/sql/query_syntax/groupby.html).
It groups together all the columns in the SELECT statement that aren't enclosed within aggregate functions. This streamlines the syntax by keeping the list of columns in one place and helps avoid errors by ensuring that the level of detail in your SELECT matches the grouping in your GROUP BY clause.
sqlparser part supports it now with the 0.38.0 release.
What changes are included in this PR?
sqlparser is updated from 0.37.0 to 0.38.0.
select_to_plan()can handle ALL option ofGroupByExpr, by grouping all select expressions except aggregate functions..slt tests added.
Are these changes tested?
Yes, with groupby.slt tests extended.
Are there any user-facing changes?
Users can make use of GROUP BY ALL syntax for large grouping sets.