yashlimbad commented on code in PR #4840:
URL: https://github.com/apache/calcite/pull/4840#discussion_r2992471614


##########
core/src/main/java/org/apache/calcite/plan/RelOptUtil.java:
##########
@@ -4818,22 +4838,55 @@ 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);
+        if (!variablesSet.isEmpty() && correlateVariableChild != null) {
+          CorrelationId id = Iterables.getOnlyElement(variablesSet);

Review Comment:
   my bad, updating whole variable set now



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