chunweilei commented on a change in pull request #1833: [CALCITE-3828] 
MergeJoin throws NPE in case of null keys
URL: https://github.com/apache/calcite/pull/1833#discussion_r384433566
 
 

 ##########
 File path: 
linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java
 ##########
 @@ -3829,6 +3829,12 @@ private boolean advance() {
       TInner right = rightEnumerator.current();
       TKey rightKey = innerKeySelector.apply(right);
       for (;;) {
+        // mergeJoin assumes inputs sorted in ascending order with nulls last,
+        // if we reach a null key, we are done
+        if (leftKey == null || rightKey == null) {
+          done = true;
 
 Review comment:
   ```we are done``` -> ```we are done.``` ?

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


With regards,
Apache Git Services

Reply via email to