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



##########
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:
       Then the problem is not here, it would be in the module that generates 
the plan.
   Can you please try to produce a unit test that shows:
   - The mismatched expected results vs actual result
   - The generated plan, showing an EnumerableMergeJoin whose inputs are not 
sorted as they're supposed to




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