zabetak commented on a change in pull request #2419:
URL: https://github.com/apache/calcite/pull/2419#discussion_r640758228



##########
File path: core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java
##########
@@ -1755,6 +1758,20 @@ private static boolean 
sameRelCollectionNoOrderConsidered(
     return true;
   }
 
+  private static @Nullable List<RexNode> compenProjs(List<RexNode> 
queryRexNodes,
+      List<RexNode> targetRexNodes) {
+    List<RexNode> compenProjs = new ArrayList<>();
+    for (int i = 0; i < queryRexNodes.size(); i++) {
+      RexNode rexNode = queryRexNodes.get(i);
+      int index = targetRexNodes.indexOf(rexNode);
+      if (index < 0) {
+        return null;
+      }
+      compenProjs.add(new RexInputRef(index, rexNode.getType()));
+    }
+    return compenProjs;
+  }
+

Review comment:
       I had the impression that it was the responsibility of the compensation 
shuttle (`getRexShuttle`) to do this work. Why is it necessary to have a 
separate method?




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to