zzwqqq commented on code in PR #5385:
URL: https://github.com/apache/calcite/pull/5385#discussion_r4610993672


##########
core/src/main/java/org/apache/calcite/sql2rel/CorrelateProjectExtractor.java:
##########
@@ -187,7 +191,11 @@ private static boolean isDirectFieldAccess(RexNode node, 
CorrelationId id) {
     return builder.build();
   }
 
-  /** Applies the visitor within the specified correlation scope. */
+  /** Applies the visitor within the scope of an outer correlation binding.
+   *
+   * <p>The scope is the part of {@code root} where {@code id} refers to the
+   * binding defined outside {@code root}. References to nested bindings

Review Comment:
   I agree that distinct IDs for distinct bindings would simplify the analysis. 
This PR preserves the existing IDs and scope handling in `findInputRel`. 
[CALCITE-7753](https://github.com/apache/calcite/commit/25d62c555af1814d0789f85ff5fc6b4489d52781)
 also covers nested Correlates reusing an ID. I think alpha-renaming would be a 
very worthwhile improvement.



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