You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2022/09/01 02:28:16 UTC

[GitHub] [calcite] jaystarshot commented on a diff in pull request #2745: [CALCITE-4512] GROUP BY expression with argument name same with SELEC…

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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org