[CALCITE-7647] Support SELECT * in GROUP BY ALL and ORDER BY ALL#5089
Open
tisyabhatia wants to merge 1 commit into
Open
[CALCITE-7647] Support SELECT * in GROUP BY ALL and ORDER BY ALL#5089tisyabhatia wants to merge 1 commit into
tisyabhatia wants to merge 1 commit into
Conversation
Expand a bare or qualified star in the SELECT clause to its underlying columns when rewriting GROUP BY ALL / ORDER BY ALL, so those clauses no longer reject SELECT *. Star items are expanded via the existing column-enumeration path (matching normal SELECT * semantics, including NATURAL JOIN coalescing), before the placeholder is replaced with the concrete keys.
mihaibudiu
reviewed
Jul 8, 2026
| * memoized grouping set with the not-yet-rewritten placeholder. The fresh | ||
| * {@code items}/{@code fields} must stay paired for NATURAL/USING index | ||
| * alignment. */ | ||
| private List<SqlNode> expandStarForAllRewrite(SqlSelect select, SqlNode starItem) { |
Contributor
There was a problem hiding this comment.
how does this differ from expand star?
Can this be avoided by doing the rewriteOrderByAll after the star expansion?
Contributor
Author
There was a problem hiding this comment.
expandStarForAllRewrite just runs the normal star expansion on the *. I don't call the public expandStar because it expands the whole SELECT list before GROUP BY ALL is replaced and that makes the real columns look "not grouped."
|
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.



Jira Link
CALCITE-7647
Changes Proposed
Expand a bare or qualified star in the
SELECTclause to its underlying columns when rewritingGROUP BY ALL/ORDER BY ALL, so those clauses no longer rejectSELECT *. Star items are expanded via the existing column-enumeration path (matching normalSELECT *semantics), before the placeholder is replaced with the concrete keys.