korlov42 commented on a change in pull request #9143:
URL: https://github.com/apache/ignite/pull/9143#discussion_r649174881



##########
File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rel/IgniteMergeJoin.java
##########
@@ -173,24 +184,34 @@ else if (isPrefix(rightCollation.getKeys(), 
joinInfo.rightKeys))// preserve righ
         Map<Integer, Integer> rightToLeft = joinInfo.pairs().stream()
             .collect(Collectors.toMap(p -> p.target, p -> p.source));
 
-        List<Integer> collationLeftPrj = new ArrayList<>();
+        List<Integer> collationLeftPrj = new 
ArrayList<>(collation.getKeys().size());
 
         for (Integer c : collation.getKeys()) {
             collationLeftPrj.add(
                 c >= rightOff ? rightToLeft.get(c - rightOff) : c

Review comment:
       looks like there is another bug: we can't preserve collation if required 
collation contains right table's field outside of join pairs 




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