Vladsz83 commented on code in PR #13455:
URL: https://github.com/apache/ignite/pull/13455#discussion_r3747968470


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/MergeJoinNode.java:
##########
@@ -241,7 +241,9 @@ protected boolean rightFinished(boolean 
withMaterialization) {
     /** */
     protected boolean checkJoinFinished() throws Exception {
         if (!finishing) {
-            finishing = true;
+            if (leftFinished() && rightFinished(true))

Review Comment:
   What if not finished? Why we clear all then?



##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/CorrelatesIntegrationTest.java:
##########
@@ -90,19 +96,22 @@ public void testCorrelatesCollision() {
         sql("INSERT INTO test1 VALUES (11, 1), (12, 2), (13, 3)");
         sql("INSERT INTO test2 VALUES (11, 1), (12, 1), (13, 4)");
 
-        // Collision by correlate variables in the left hand.
-        assertQuery("SELECT * FROM test1 WHERE " +
-            "EXISTS(SELECT * FROM test2 WHERE test1.a=test2.a AND 
test1.b<>test2.c) " +
-            "AND NOT EXISTS(SELECT * FROM test2 WHERE test1.a=test2.a AND 
test1.b<test2.c)")
-            .returns(12, 2)
-            .check();
-
-        // Collision by correlate variables in both, left and right hands.
-        assertQuery("SELECT * FROM test1 WHERE " +
-            "EXISTS(SELECT * FROM test2 WHERE (SELECT test1.a)=test2.a AND 
(SELECT test1.b)<>test2.c) " +
-            "AND NOT EXISTS(SELECT * FROM test2 WHERE (SELECT test1.a)=test2.a 
AND (SELECT test1.b)<test2.c)")
-            .returns(12, 2)
-            .check();
+        for (HintDefinition noHint : List.of(NO_NL_JOIN, NO_CNL_JOIN, 
NO_HASH_JOIN)) {

Review Comment:
   Should we define which join we watn use insteed? `NO_JOIN` does not 
guarantee another certain join wouldn't be taken twice.



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