wenhuitang commented on a change in pull request #1462: 
[CALCITE-3353]ProjectJoinTransposeRule caused AssertionError when creating a 
new Join
URL: https://github.com/apache/calcite/pull/1462#discussion_r351569447
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
 ##########
 @@ -436,6 +436,29 @@ public static void verifyTypeEquivalence(
     return mapping;
   }
 
+  /**
+   * Returns a permutation describing where the Project's fields come from
+   * after the Project is pushed down.
+   */
+  public static Mappings.TargetMapping permutationPushDownProject(
+      List<RexNode> nodes,
+      RelDataType inputRowType,
+      int sourceOffset,
+      int targetOffset) {
+    final Mappings.TargetMapping mapping =
+        Mappings.create(MappingType.PARTIAL_FUNCTION,
+            inputRowType.getFieldCount() + sourceOffset,
+            nodes.size() + targetOffset);
+    for (Ord<RexNode> node : Ord.zip(nodes)) {
+      if (node.e instanceof RexInputRef) {
 
 Review comment:
   It seems unnecessary to do that,since RelFieldCollation is only associated 
with RexInputRef, and the index of the operand of RexCall which is RexInputRef 
has not been changed after Project was push down

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


With regards,
Apache Git Services

Reply via email to