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



##########
File path: 
core/src/main/java/org/apache/calcite/adapter/enumerable/EnumTraitsUtils.java
##########
@@ -148,4 +149,52 @@ private static boolean isCollationOnTrivialExpr(
       return null;
     }
   }
+
+  // EnumerableNestedLoopJoin and EnumerableBatchNestedLoopJoin traits 
passdown shall only
+  // pass through collation to left input. It is because for 
EnumerableNestedLoopJoin always
+  // uses left input as the outer loop, thus only left input can preserve 
ordering.
+  // Push sort both to left and right inputs does not help right outer join. 
It's because in
+  // implementation, EnumerableNestedLoopJoin produces (null, right_unmatched) 
all together,
+  // which does not preserve ordering from right side.
+  static Pair<RelTraitSet, List<RelTraitSet>> 
passThroughTraitsForNestedLoopJoin(

Review comment:
       Pushed a commit to make HashJoin and Correlate reuse the code. Also 
rename this class to `EnumerableTraitUtils`




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to