mihaibudiu commented on code in PR #4382:
URL: https://github.com/apache/calcite/pull/4382#discussion_r2109687587


##########
core/src/main/java/org/apache/calcite/rel/rules/SubQueryRemoveRule.java:
##########
@@ -840,6 +857,29 @@ private static List<RexNode> fields(RelBuilder builder, 
int fieldCount) {
     return projects;
   }
 
+  /**
+   * Replace every {@link RexFieldAccess} in the given {@link RelNode}
+   * that reference the specified {@link CorrelationId} with another {@link 
CorrelationId}.
+   */
+  public static RelNode replaceCorrelationId(RexBuilder rexBuilder, RelNode 
node,
+      final CorrelationId from, final CorrelationId to, RelDataType type) {
+    return node.accept(new RelHomogeneousShuttle() {

Review Comment:
   I am skeptical, because there is no way the RexVisitor can call your 
homogeneous shuttle back, since it does not have a handle to it.
   Can there be subqueries in expressions at this point, or are you assuming 
they have been expanded?
   



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