You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/06/19 09:02:19 UTC

[GitHub] [calcite] rubenada opened a new pull request #2037: [CALCITE-3834] Support AntiJoin in EnumerableMergeJoin

rubenada opened a new pull request #2037:
URL: https://github.com/apache/calcite/pull/2037


   [[CALCITE-3834](https://issues.apache.org/jira/browse/CALCITE-3834)] Support AntiJoin in EnumerableMergeJoin


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [calcite] rubenada commented on a change in pull request #2037: [CALCITE-3834] Support AntiJoin in EnumerableMergeJoin

Posted by GitBox <gi...@apache.org>.
rubenada commented on a change in pull request #2037:
URL: https://github.com/apache/calcite/pull/2037#discussion_r447452267



##########
File path: linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java
##########
@@ -3878,6 +3879,8 @@ public void remove() {
     private final Comparator<TKey> comparator;
     private boolean done;
     private Enumerator<TResult> results;
+    // only used for ANTI join: if right input is over, all remaining elements from left are results
+    private boolean remainingLeft;

Review comment:
       Correct, it means the right input is over, but the left is not; hence all remaining tuples from the left relation are results for the anti-join




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [calcite] rubenada merged pull request #2037: [CALCITE-3834] Support AntiJoin in EnumerableMergeJoin

Posted by GitBox <gi...@apache.org>.
rubenada merged pull request #2037:
URL: https://github.com/apache/calcite/pull/2037


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [calcite] hsyuan commented on pull request #2037: [CALCITE-3834] Support AntiJoin in EnumerableMergeJoin

Posted by GitBox <gi...@apache.org>.
hsyuan commented on pull request #2037:
URL: https://github.com/apache/calcite/pull/2037#issuecomment-654563877


   Sorry for my late action. Will do it tomorrow. :)


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [calcite] hsyuan commented on pull request #2037: [CALCITE-3834] Support AntiJoin in EnumerableMergeJoin

Posted by GitBox <gi...@apache.org>.
hsyuan commented on pull request #2037:
URL: https://github.com/apache/calcite/pull/2037#issuecomment-646665024


   @rubenada Thanks for the clarification. That make much sense now.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [calcite] rubenada commented on pull request #2037: [CALCITE-3834] Support AntiJoin in EnumerableMergeJoin

Posted by GitBox <gi...@apache.org>.
rubenada commented on pull request #2037:
URL: https://github.com/apache/calcite/pull/2037#issuecomment-654137045


   @hsyuan gentle reminder. I would to have this one reviewed, so that it can get into the next release.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [calcite] rubenada commented on pull request #2037: [CALCITE-3834] Support AntiJoin in EnumerableMergeJoin

Posted by GitBox <gi...@apache.org>.
rubenada commented on pull request #2037:
URL: https://github.com/apache/calcite/pull/2037#issuecomment-646651556


   @hsyuan the behavior of our JoinType ANTI is not like a NOT IN, but a NOT EXISTS.
   Some time ago, I added a test case for this precise scenario in EnumerableCorrelateTest#antiJoinCorrelateWithNullValues (there is a comment in there explaining the situation).
   Bear in mind that, at that time, ANTI was a CorrelateJoinType, but not a JoinType. Later, with the big Join refactoring, ANTI (together with SEMI) was added as JoinType, and CorrelateJoinType was deprecated (and later removed). So, we must see ANTI as a NOT EXISTS, whose null management is not as drastic as NOT IN.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [calcite] hsyuan commented on a change in pull request #2037: [CALCITE-3834] Support AntiJoin in EnumerableMergeJoin

Posted by GitBox <gi...@apache.org>.
hsyuan commented on a change in pull request #2037:
URL: https://github.com/apache/calcite/pull/2037#discussion_r447379011



##########
File path: linq4j/src/main/java/org/apache/calcite/linq4j/EnumerableDefaults.java
##########
@@ -3878,6 +3879,8 @@ public void remove() {
     private final Comparator<TKey> comparator;
     private boolean done;
     private Enumerator<TResult> results;
+    // only used for ANTI join: if right input is over, all remaining elements from left are results
+    private boolean remainingLeft;

Review comment:
       1 trivial question:
   If it is true, does it mean we have enumerated all the right tuples, but there are still some tuple remaining (not yet matched) on the left relation?




----------------------------------------------------------------
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:
users@infra.apache.org