rubenada commented on a change in pull request #2006:
URL: https://github.com/apache/calcite/pull/2006#discussion_r473006265
##########
File path:
core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableMergeJoin.java
##########
@@ -222,6 +277,30 @@ public static boolean isMergeJoinSupported(JoinRelType
joinType) {
return mapping;
}
+ private RelCollation extendCollation(RelCollation collation, List<Integer>
keys) {
+ List<RelFieldCollation> fieldsForNewCollation = new
ArrayList<>(keys.size());
+ fieldsForNewCollation.addAll(collation.getFieldCollations());
+ Set<Integer> keySet = new HashSet<>(keys);
+ for (RelFieldCollation rf : collation.getFieldCollations()) {
+ keySet.remove(rf.getFieldIndex());
+ }
+ for (Integer i : keySet) {
+ fieldsForNewCollation.add(new RelFieldCollation(i));
+ }
+ return RelCollations.of(fieldsForNewCollation);
+ }
+
+ private RelCollation removeCollationFieldsNotOnJoinKey(
Review comment:
I also think the method name is counter-intuitive. It is actually not
removing anything, it just builds a new collation based on a "source"
collation, considering only the fields which are part of the joinKeys. I would
propose as name e.g. `reduceCollation`, `intersect`, or something like that..
----------------------------------------------------------------
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]