zzwqqq commented on code in PR #5385:
URL: https://github.com/apache/calcite/pull/5385#discussion_r4534578208
##########
core/src/main/java/org/apache/calcite/sql2rel/CorrelateProjectExtractor.java:
##########
@@ -202,99 +187,77 @@ private static boolean isDirectFieldAccess(RexNode node,
CorrelationId id) {
return builder.build();
}
- /**
- * Traverses a plan and finds all simply correlated row expressions with the
specified id.
- */
- private static Set<RexNode> findCorrelationDependentCalls(CorrelationId
corrId, RelNode plan) {
- SimpleCorrelationCollector finder = new SimpleCorrelationCollector(corrId);
- plan.accept(new RelHomogeneousShuttle() {
- @Override public RelNode visit(RelNode other) {
- // Don't descend into a nested correlate that reuses this id: the refs
below belong to it.
- if (other instanceof Correlate
- && ((Correlate) other).getCorrelationId().equals(corrId)) {
- return other;
+ /** Applies the visitor within the specified correlation scope. */
Review Comment:
Thanks. I've defined the scope here: the part of `root` where `id` refers to
a binding outside `root`. References to nested bindings with the same id are
excluded.
--
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]