AMashenkov commented on a change in pull request #411:
URL: https://github.com/apache/ignite-3/pull/411#discussion_r741702634
##########
File path:
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rel/IgniteMergeJoin.java
##########
@@ -166,30 +168,39 @@ else if (isPrefix(rightCollation.getKeys(),
joinInfo.rightKeys))// preserve righ
int rightOff = this.left.getRowType().getFieldCount();
- Map<Integer, Integer> rightToLeft = joinInfo.pairs().stream()
- .collect(Collectors.toMap(p -> p.target, p -> p.source));
+ List<IntPair> pairs = joinInfo.pairs();
+
+ Int2IntOpenHashMap rightToLeft = new Int2IntOpenHashMap(pairs.size());
+
+ for (IntPair pair : pairs)
+ rightToLeft.put(pair.target, pair.source);
List<Integer> collationLeftPrj = new ArrayList<>();
- for (Integer c : collation.getKeys()) {
+ for (RelFieldCollation fieldCollation :
collation.getFieldCollations()) {
+ int c = fieldCollation.getFieldIndex();
collationLeftPrj.add(
- c >= rightOff ? rightToLeft.get(c - rightOff) : c
+ c >= rightOff ? rightToLeft.get(c - rightOff) : c
);
}
boolean preserveNodeCollation = false;
List<Integer> newLeftCollation, newRightCollation;
- Map<Integer, Integer> leftToRight = joinInfo.pairs().stream()
- .collect(Collectors.toMap(p -> p.source, p -> p.target));
+ Int2IntOpenHashMap leftToRight = new Int2IntOpenHashMap(pairs.size());
+
+ for (IntPair pair : pairs)
+ leftToRight.put(pair.source, pair.target);
if (isPrefix(collationLeftPrj, joinInfo.leftKeys)) { // preserve
collation
Review comment:
Commons.isPrefix and Commons.maxPrefix creates a HashSet with boxed
values underneath.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]