snuyanzin commented on code in PR #5231:
URL: https://github.com/apache/calcite/pull/5231#discussion_r4014812589
##########
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:
thank you for the feedback @zabetak it looks reasonable
also tested Flink code with this change
--
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]