amaliujia commented on a change in pull request #2011:
URL: https://github.com/apache/calcite/pull/2011#discussion_r437586908



##########
File path: core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
##########
@@ -3766,6 +3771,115 @@ private static void fix(List<RexNode> operands, int 
before, int after) {
     }
   }
 
+  /**
+   * Gets a shuttle to expand RexLocalRef.
+   */
+  public static RexShuttle getExpandShuttle(RexProgram rexProgram) {
+    return new RexShuttle() {
+      @Override public RexNode visitLocalRef(RexLocalRef localRef) {
+        return rexProgram.expandLocalRef(localRef);
+      }
+    };
+  }
+
+  /**
+   * Determine whether there is mapping between project input and output 
fields.
+   * Bail out if sort relies on non-trivial expressions.
+   */
+  private static boolean isCollationOnTrivialExpr(
+      List<RexNode> projects,RelDataTypeFactory typeFactory,
+      Mappings.TargetMapping map, RelFieldCollation fc, boolean passDown) {
+    final int index = fc.getFieldIndex();
+    int target = map.getTargetOpt(index);

Review comment:
       I think the part of construct pairs of traits for `passThroughTraits` 
and `dervieTratis` are better kept in Enumerable nodes, at least for better 
readbility.




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