snuyanzin commented on code in PR #5231:
URL: https://github.com/apache/calcite/pull/5231#discussion_r4178959475


##########
core/src/main/java/org/apache/calcite/sql2rel/CorrelateProjectExtractor.java:
##########
@@ -115,8 +116,11 @@ private static boolean isDirectFieldAccess(RexNode node, 
CorrelationId id) {
     boolean isTrivialCorrelation =
         callsWithCorrelationInRight.stream()
             .allMatch(exp -> isDirectFieldAccess(exp, 
correlate.getCorrelationId()));
+    // A nested correlate on the right re-binding the same id owns the refs 
below it.
+    boolean rightRebindsCorrelationId =
+        rebindsCorrelationId(right, correlate.getCorrelationId());

Review Comment:
   @zabetak sorry for pinging you
   double check if you are ok with the recent changes since you proposed doing 
it in such a way



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