yashlimbad commented on code in PR #4840:
URL: https://github.com/apache/calcite/pull/4840#discussion_r3007496876
##########
core/src/main/java/org/apache/calcite/plan/RelOptUtil.java:
##########
@@ -4818,22 +4849,61 @@ public RexInputConverter(
null,
leftDestFields,
rightDestFields,
- adjustments);
+ adjustments,
+ 0,
+ null);
}
public RexInputConverter(
RexBuilder rexBuilder,
@Nullable List<RelDataTypeField> srcFields,
@Nullable List<RelDataTypeField> destFields,
int[] adjustments) {
- this(rexBuilder, srcFields, destFields, null, null, adjustments);
+ this(rexBuilder, srcFields, destFields, null, null, adjustments, 0,
null);
}
public RexInputConverter(
RexBuilder rexBuilder,
@Nullable List<RelDataTypeField> srcFields,
int[] adjustments) {
- this(rexBuilder, srcFields, null, null, null, adjustments);
+ this(rexBuilder, srcFields, null, null, null, adjustments, 0, null);
+ }
+
+ public RexInputConverter(
+ RexBuilder rexBuilder,
+ @Nullable List<RelDataTypeField> srcFields,
+ @Nullable List<RelDataTypeField> destFields,
+ int[] adjustments,
+ int offset,
+ RelNode child) {
+ this(rexBuilder, srcFields, destFields, null, null, adjustments, offset,
child);
+ }
+
+ @Override public RexNode visitSubQuery(RexSubQuery subQuery) {
+ boolean[] update = {false};
+ List<RexNode> clonedOperands = visitList(subQuery.operands, update);
+ if (update[0]) {
+ subQuery = subQuery.clone(subQuery.getType(), clonedOperands);
+ }
+ final Set<CorrelationId> variablesSet =
+ RelOptUtil.getVariablesUsed(subQuery.rel);
Review Comment:
correlation ID belongs to outer scope, that's the point of adding it. please
check the test
`RelDecorrelatorTest#testCorrelatedVariableIndexForExistsClause()`
--
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]