suibianwanwank commented on code in PR #4382:
URL: https://github.com/apache/calcite/pull/4382#discussion_r2110995933
##########
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:
You're right, now I understand what you meant. I've made the corresponding
changes, but currently this rule's implementation has other issues in
multi-subQuery scenarios. I might need to spend some more time on it.
--
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]