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


##########
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:
   `RexSubQuery` extends `RexCall`, operands will be visited sequentially. I 
believe it supports recursion. Would you like me to add a test?



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