[CALCITE-7647] Support SELECT * in GROUP BY ALL and ORDER BY ALL#5089
[CALCITE-7647] Support SELECT * in GROUP BY ALL and ORDER BY ALL#5089tisyabhatia wants to merge 1 commit into
Conversation
|
I think something went wrong in your rebase, you are showing some commits which you shouldn't. Do not merge main, rebase on main. |
0d8a6af to
9b20a08
Compare
mihaibudiu
left a comment
There was a problem hiding this comment.
I approved, but please make the messages match
| !ok | ||
|
|
||
| # [CALCITE-7647] ORDER BY ALL expands SELECT * to every underlying column | ||
| # [CALCITE-7647] ORDER BY ALL expands SELECT * to every underlying column. |
There was a problem hiding this comment.
You should use the same message here as the commit/JIRA message
There was a problem hiding this comment.
Done, thank you for your reviews @mihaibudiu and @xuzifu666
There was a problem hiding this comment.
I approve it If you address comment raised by @mihaibudiu .
9b20a08 to
c6bdc63
Compare
|
Good. Now you need to squash the commits to one with this message and we can merge |
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. Add rewritesTo assertions that show the columns SELECT * expands to as grouping/sort keys, and tighten the .ok()-case comments to match what they actually verify. The expected output in the agg.iq / sort.iq cases was validated against DuckDB.
c6bdc63 to
c99c1a4
Compare
|
|
|
||
| # [CALCITE-7647] Support SELECT * in GROUP BY ALL and ORDER BY ALL. | ||
| # ORDER BY ALL expands SELECT * to every underlying column. | ||
| # Expected output validated against DuckDB (https://shell.duckdb.org). |
There was a problem hiding this comment.
We can keep this in the PR; let's not put it in the test file.
| +---+---+ | ||
| (3 rows) | ||
|
|
||
| !ok |
There was a problem hiding this comment.
Could you add a test case involving duplicate columns? For example, SELECT *, deptno FROM emp GROUP BY ALL, or perhaps some other edge cases?
There was a problem hiding this comment.
Please address these new comments too



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.