mihaibudiu commented on code in PR #5089:
URL: https://github.com/apache/calcite/pull/5089#discussion_r3546300184


##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -5256,6 +5256,24 @@ protected void validateOrderList(SqlSelect select) {
     }
   }
 
+  /** Expands a single "*" or "t.*" select item into its underlying columns,
+   * for a GROUP BY ALL / ORDER BY ALL rewrite.
+   *
+   * <p>Calls the private {@code expandStar} core directly (not the public
+   * {@code expandStar(SqlNodeList, SqlSelect, boolean)} wrapper), with fresh
+   * collections: the wrapper would derive types over every select item and
+   * mark the expanded list, poisoning {@link AggregatingSelectScope}'s
+   * 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) {

Review Comment:
   how does this differ from expand star?
   Can this be avoided by doing the rewriteOrderByAll after the star expansion?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to