tisyabhatia commented on code in PR #5089:
URL: https://github.com/apache/calcite/pull/5089#discussion_r3546401995
##########
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:
`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 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]