DaZuiZui commented on code in PR #17960:
URL: https://github.com/apache/iotdb/pull/17960#discussion_r3432903471


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/StatementAnalyzer.java:
##########
@@ -1670,11 +2185,25 @@ private SelectAnalysis analyzeSelect(QuerySpecification 
node, Scope scope) {
               outputPosition++;
             }
           } else {
+            SelectAliasLookup visibleAliases = visibleAliasBuilder.build();

Review Comment:
   Thanks for the suggestion. Addressed in 3bd3a8d445: SELECT-list LCA 
rewriting now reads from a builder-backed SelectAliasResolver while walking the 
SELECT list, so it avoids rebuilding immutable snapshots for each SingleColumn 
and only snapshots once for later clauses. I also added regression coverage for 
a wide SELECT-list LCA chain, delimited alias case sensitivity, named WINDOW 
definitions not seeing SELECT aliases, DISTINCT with LCA and no ORDER BY, and 
LCA references in window frame bounds.
   
   Verified with:
   
   ```
   ./mvnw spotless:apply -pl iotdb-core/datanode
   ./mvnw -nsu test -pl iotdb-core/datanode -Dtest=SelectAliasReuseTest
   ```



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

Reply via email to