rubenada commented on code in PR #2838:
URL: https://github.com/apache/calcite/pull/2838#discussion_r907111550
##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -6661,6 +6661,11 @@ static class ExtendedExpander extends Expander {
SqlIdentifier sid = (SqlIdentifier) expr;
final SqlIdentifier fqId = getScope().fullyQualify(sid).identifier;
expr = expandDynamicStar(sid, fqId);
+ } else {
+ requireNonNull(expr, "expr");
+ SqlNode exprCopy = expr.clone(expr.getParserPosition());
Review Comment:
Thanks for your work @hannerwang ; I agree with @yingyuwang the new solution
seems cleaner.
So, if I understand correctly, the current PR will fix
[CALCITE-5045](https://issues.apache.org/jira/browse/CALCITE-5045) and also
[CALCITE-5145](https://issues.apache.org/jira/browse/CALCITE-5145), right? In
which case, could you please amend the commit message to reflect both fixes:
```
[CALCITE-5045] Alias within GroupingSets throws type mis-match exception
[CALCITE-5145] CASE statement within GROUPING SETS throws type mis-match
exception
```
--
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]