jaystarshot commented on code in PR #2745:
URL: https://github.com/apache/calcite/pull/2745#discussion_r960165133
##########
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java:
##########
@@ -6590,20 +6593,25 @@ static class ExtendedExpander extends Expander {
final SqlSelect select;
final SqlNode root;
final boolean havingExpr;
+ final Set<SqlNode> aliasOrdinalExpandSet = Sets.newIdentityHashSet();
ExtendedExpander(SqlValidatorImpl validator, SqlValidatorScope scope,
SqlSelect select, SqlNode root, boolean havingExpr) {
super(validator, scope);
this.select = select;
this.root = root;
this.havingExpr = havingExpr;
+ if (!havingExpr) {
+ addExpandableExpressions();
+ }
}
@Override public @Nullable SqlNode visit(SqlIdentifier id) {
if (id.isSimple()
&& (havingExpr
? validator.config().conformance().isHavingAlias()
- : validator.config().conformance().isGroupByAlias())) {
+ : (validator.config().conformance().isGroupByAlias()
Review Comment:
Why not create a new Expander which extends Expander and use that in
validateGroupBy if flag is set?
--
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]