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/12/19 06:21:56 UTC

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

hannerwang commented on code in PR #2745:
URL: https://github.com/apache/calcite/pull/2745#discussion_r1051847750


##########
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:
   There may be a lot of duplicate codes and changes so that review will be difficult.



-- 
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