rubenada commented on a change in pull request #2550:
URL: https://github.com/apache/calcite/pull/2550#discussion_r718664412



##########
File path: 
linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java
##########
@@ -4275,13 +4275,22 @@ private boolean advance() {
           // mergeJoin assumes inputs sorted in ascending order with nulls 
last,
           // if we reach a null key, we are done.
           if (leftKey == null || rightKey == null) {
-            if (joinType == JoinType.LEFT || (joinType == JoinType.ANTI && 
leftKey != null)) {
-              // all remaining items in left are results for left/anti join
-              remainingLeft = true;
-              return true;
+            if (rightKey == null || !(getLeftEnumerator() instanceof 
MergeJoinEnumerator

Review comment:
       This ad-hoc code should not be needed, as long as MergeJoin inputs 
respect the MergeJoin pre-requisite: they must be sorted by join keys in 
ascending order nulls last.
   I'd say the issue is not in this code, but on the module that creates the 
EnumerableMergeJoin, which perhaps does not introduce the appropriate Sort on 
its inputs.




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


Reply via email to