This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 8e9fc45acb3677ce5e78a107941dfb76f7905266
Author: Jerry Hu <[email protected]>
AuthorDate: Wed Sep 20 10:41:06 2023 +0800

    [fix](nested_join) incorrect result of semi/anti mark join (#24616)
---
 be/src/vec/exec/join/vnested_loop_join_node.cpp                   | 2 +-
 regression-test/data/nereids_syntax_p0/sub_query_correlated.out   | 8 --------
 .../suites/nereids_syntax_p0/sub_query_correlated.groovy          | 6 +++---
 3 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/be/src/vec/exec/join/vnested_loop_join_node.cpp 
b/be/src/vec/exec/join/vnested_loop_join_node.cpp
index b1267831b3..6265f6c609 100644
--- a/be/src/vec/exec/join/vnested_loop_join_node.cpp
+++ b/be/src/vec/exec/join/vnested_loop_join_node.cpp
@@ -495,7 +495,7 @@ void 
VNestedLoopJoinNode::_finalize_current_phase(MutableBlock& mutable_block, s
             DCHECK_LE(_left_block_start_pos + _left_side_process_count, 
_left_block.rows());
             for (int j = _left_block_start_pos;
                  j < _left_block_start_pos + _left_side_process_count; ++j) {
-                mark_data.emplace_back(IsSemi != 
_cur_probe_row_visited_flags[j]);
+                mark_data.emplace_back(IsSemi == 
_cur_probe_row_visited_flags[j]);
             }
             for (size_t i = 0; i < _num_probe_side_columns; ++i) {
                 const ColumnWithTypeAndName src_column = 
_left_block.get_by_position(i);
diff --git a/regression-test/data/nereids_syntax_p0/sub_query_correlated.out 
b/regression-test/data/nereids_syntax_p0/sub_query_correlated.out
index 15f4567365..162cdb3b95 100644
--- a/regression-test/data/nereids_syntax_p0/sub_query_correlated.out
+++ b/regression-test/data/nereids_syntax_p0/sub_query_correlated.out
@@ -406,15 +406,7 @@
 2      5
 3      3
 3      4
-
--- !doris_6937_2 --
-1      2
-1      3
-2      4
-2      5
 20     2
 22     3
 24     4
-3      3
-3      4
 
diff --git 
a/regression-test/suites/nereids_syntax_p0/sub_query_correlated.groovy 
b/regression-test/suites/nereids_syntax_p0/sub_query_correlated.groovy
index 30f93b857a..c13cac2d86 100644
--- a/regression-test/suites/nereids_syntax_p0/sub_query_correlated.groovy
+++ b/regression-test/suites/nereids_syntax_p0/sub_query_correlated.groovy
@@ -452,17 +452,17 @@ suite ("sub_query_correlated") {
                                              OR exists (SELECT * FROM 
sub_query_correlated_subquery3, sub_query_correlated_subquery5 WHERE 
sub_query_correlated_subquery1.k2 = sub_query_correlated_subquery3.v1 and 
sub_query_correlated_subquery3.v1 = sub_query_correlated_subquery5.k1))
     """
 
-    order_qt_doris_6937 """
+    qt_doris_6937 """
     SELECT *
         FROM sub_query_correlated_subquery1
         WHERE EXISTS 
             (SELECT k1
             FROM sub_query_correlated_subquery3
             WHERE sub_query_correlated_subquery1.k1 > 
sub_query_correlated_subquery3.v1)
-                OR k1 < 10;
+                OR k1 < 10
+        order by k1, k2;
     """
 
-    // uncomment this after DORIS-7051 is fixed
     // order_qt_doris_6937_2 """
     //     select * from sub_query_correlated_subquery1 where 
sub_query_correlated_subquery1.k1 not in (select 
sub_query_correlated_subquery3.k3 from sub_query_correlated_subquery3 where 
sub_query_correlated_subquery3.v2 > sub_query_correlated_subquery1.k2) or k1 < 
10 order by k1, k2;
     // """


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to