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


##########
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:
   So I guess, yes, I think you need to add a test where a subquery appears in 
an expression within the existing subquery.



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