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

morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
     new 7b526a0cd5 [cherrypick](branch-1.2)Pick 5 commits related to hash join 
(#16542)
7b526a0cd5 is described below

commit 7b526a0cd5659276df5e77c7e5afc801536365aa
Author: Gabriel <[email protected]>
AuthorDate: Thu Feb 9 12:39:05 2023 +0800

    [cherrypick](branch-1.2)Pick 5 commits related to hash join (#16542)
    
    revert #16535
    
    pick #16506 #16435 #15569 #16402 #16166
---
 be/src/vec/exec/join/process_hash_table_probe.h    |   5 +-
 .../vec/exec/join/process_hash_table_probe_impl.h  | 240 +++++---
 be/src/vec/exec/join/vhash_join_node.cpp           |   5 +-
 be/src/vec/exec/join/vhash_join_node.h             |   2 -
 be/src/vec/exec/join/vjoin_node_base.cpp           |   3 +-
 .../java/org/apache/doris/analysis/Analyzer.java   |  38 +-
 .../org/apache/doris/analysis/JoinOperator.java    |   5 +
 .../org/apache/doris/analysis/StmtRewriter.java    |  21 +-
 .../java/org/apache/doris/analysis/TableRef.java   |   3 +
 .../org/apache/doris/planner/HashJoinNode.java     |   3 +-
 .../org/apache/doris/planner/JoinNodeBase.java     |  37 +-
 .../apache/doris/planner/NestedLoopJoinNode.java   |   3 +-
 .../doris/planner/RuntimeFilterGenerator.java      |   2 +-
 .../apache/doris/planner/SingleNodePlanner.java    |   2 +-
 gensrc/thrift/PlanNodes.thrift                     |   4 +-
 .../correctness/test_subquery_in_disjunction.out   |  42 ++
 .../test_left_anti_join_batch_size.out             | 606 +++++++++++++++++++++
 regression-test/data/tpcds_sf1_p1/sql/q10.out      |   8 +
 regression-test/data/tpcds_sf1_p1/sql/q35.out      | 103 ++++
 regression-test/data/tpcds_sf1_p1/sql/q45.out      |  22 +
 .../test_subquery_in_disjunction.groovy            |  40 ++
 .../test_left_anti_join_batch_size.sql             |  21 +
 .../suites/datatype_p0/date/test_date_exprs.groovy |   2 +-
 regression-test/suites/tpcds_sf1_p1/sql/q10.sql    |   2 -
 regression-test/suites/tpcds_sf1_p1/sql/q35.sql    |   2 -
 regression-test/suites/tpcds_sf1_p1/sql/q45.sql    |   2 -
 26 files changed, 1111 insertions(+), 112 deletions(-)

diff --git a/be/src/vec/exec/join/process_hash_table_probe.h 
b/be/src/vec/exec/join/process_hash_table_probe.h
index 2347b3fc63..6b95b6e3e0 100644
--- a/be/src/vec/exec/join/process_hash_table_probe.h
+++ b/be/src/vec/exec/join/process_hash_table_probe.h
@@ -55,7 +55,8 @@ struct ProcessHashTableProbe {
     // TODO: opt the visited here to reduce the size of hash table
     template <bool need_null_map_for_probe, bool ignore_null, typename 
HashTableType>
     Status do_process(HashTableType& hash_table_ctx, ConstNullMapPtr null_map,
-                      MutableBlock& mutable_block, Block* output_block, size_t 
probe_rows);
+                      MutableBlock& mutable_block, Block* output_block, size_t 
probe_rows,
+                      bool is_mark_join);
     // In the presence of other join conjunct, the process of join become more 
complicated.
     // each matching join column need to be processed by other join conjunct. 
so the struct of mutable block
     // and output block may be different
@@ -64,7 +65,7 @@ struct ProcessHashTableProbe {
     Status do_process_with_other_join_conjuncts(HashTableType& hash_table_ctx,
                                                 ConstNullMapPtr null_map,
                                                 MutableBlock& mutable_block, 
Block* output_block,
-                                                size_t probe_rows);
+                                                size_t probe_rows, bool 
is_mark_join);
 
     void _process_splited_equal_matched_tuples(int start_row_idx, int 
row_count,
                                                const ColumnPtr& 
other_hit_column,
diff --git a/be/src/vec/exec/join/process_hash_table_probe_impl.h 
b/be/src/vec/exec/join/process_hash_table_probe_impl.h
index 414d8e3ff4..102dcba53b 100644
--- a/be/src/vec/exec/join/process_hash_table_probe_impl.h
+++ b/be/src/vec/exec/join/process_hash_table_probe_impl.h
@@ -153,7 +153,8 @@ template <bool need_null_map_for_probe, bool ignore_null, 
typename HashTableType
 Status ProcessHashTableProbe<JoinOpType>::do_process(HashTableType& 
hash_table_ctx,
                                                      ConstNullMapPtr null_map,
                                                      MutableBlock& 
mutable_block,
-                                                     Block* output_block, 
size_t probe_rows) {
+                                                     Block* output_block, 
size_t probe_rows,
+                                                     bool is_mark_join) {
     auto& probe_index = _join_node->_probe_index;
     auto& probe_raw_ptrs = _join_node->_probe_columns;
     if (probe_index == 0 && _items_counts.size() < probe_rows) {
@@ -229,6 +230,7 @@ Status 
ProcessHashTableProbe<JoinOpType>::do_process(HashTableType& hash_table_c
                 probe_size = 1;
             }
         }
+
         if (current_offset < _batch_size) {
             while (probe_index < probe_rows) {
                 if constexpr (ignore_null && need_null_map_for_probe) {
@@ -274,16 +276,31 @@ Status 
ProcessHashTableProbe<JoinOpType>::do_process(HashTableType& hash_table_c
                 auto current_probe_index = probe_index;
                 if constexpr (JoinOpType == TJoinOp::LEFT_ANTI_JOIN ||
                               JoinOpType == 
TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN) {
-                    if (!find_result.is_found()) {
+                    if (is_mark_join) {
                         ++current_offset;
+                        
assert_cast<doris::vectorized::ColumnVector<UInt8>&>(*mcol[mcol.size() - 1])
+                                .get_data()
+                                .template push_back(!find_result.is_found());
+                    } else {
+                        if (!find_result.is_found()) {
+                            ++current_offset;
+                        }
                     }
                     ++probe_index;
                 } else if constexpr (JoinOpType == TJoinOp::LEFT_SEMI_JOIN) {
-                    if (find_result.is_found()) {
+                    if (is_mark_join) {
                         ++current_offset;
+                        
assert_cast<doris::vectorized::ColumnVector<UInt8>&>(*mcol[mcol.size() - 1])
+                                .get_data()
+                                .template push_back(find_result.is_found());
+                    } else {
+                        if (find_result.is_found()) {
+                            ++current_offset;
+                        }
                     }
                     ++probe_index;
                 } else {
+                    DCHECK(!is_mark_join);
                     if (find_result.is_found()) {
                         auto& mapped = find_result.get_mapped();
                         // TODO: Iterators are currently considered to be a 
heavy operation and have a certain impact on performance.
@@ -382,7 +399,7 @@ template <int JoinOpType>
 template <bool need_null_map_for_probe, bool ignore_null, typename 
HashTableType>
 Status ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts(
         HashTableType& hash_table_ctx, ConstNullMapPtr null_map, MutableBlock& 
mutable_block,
-        Block* output_block, size_t probe_rows) {
+        Block* output_block, size_t probe_rows, bool is_mark_join) {
     auto& probe_index = _join_node->_probe_index;
     auto& probe_raw_ptrs = _join_node->_probe_columns;
     if (probe_index == 0 && _items_counts.size() < probe_rows) {
@@ -533,31 +550,49 @@ Status 
ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts(
                         visited_map.emplace_back(&mapped.visited);
                         ++probe_index;
                     } else {
-                        auto multi_match_last_offset = current_offset;
-                        auto it = mapped.begin();
-                        // breaks if row count exceeds batch_size
-                        for (; it.ok() && current_offset < _batch_size; ++it) {
-                            if (LIKELY(current_offset < 
_build_block_rows.size())) {
-                                _build_block_offsets[current_offset] = 
it->block_offset;
-                                _build_block_rows[current_offset] = 
it->row_num;
-                            } else {
-                                
_build_block_offsets.emplace_back(it->block_offset);
-                                _build_block_rows.emplace_back(it->row_num);
+                        // For mark join, if euqual-matched tuple count for 
one probe row
+                        // excceeds batch size, it's difficult to implement 
the logic to
+                        // split them into multiple sub blocks and handle 
them, keep the original
+                        // logic for now.
+                        if (is_mark_join) {
+                            for (auto it = mapped.begin(); it.ok(); ++it) {
+                                if (LIKELY(current_offset < 
_build_block_rows.size())) {
+                                    _build_block_offsets[current_offset] = 
it->block_offset;
+                                    _build_block_rows[current_offset] = 
it->row_num;
+                                } else {
+                                    
_build_block_offsets.emplace_back(it->block_offset);
+                                    
_build_block_rows.emplace_back(it->row_num);
+                                }
+                                ++current_offset;
+                                visited_map.emplace_back(&it->visited);
                             }
-                            ++current_offset;
-                            visited_map.emplace_back(&it->visited);
-                        }
-                        probe_row_match_iter = it;
-                        // If all matched rows for the current probe row are 
handled,
-                        // advance to next probe row.
-                        if (!it.ok()) {
-                            ++probe_index;
                         } else {
-                            // If not(which means it excceed batch size), 
probe_index is not increased and
-                            // remaining matched rows for the current probe 
row will be
-                            // handled in the next call of this function
-                            multi_matched_output_row_count =
-                                    current_offset - multi_match_last_offset;
+                            auto multi_match_last_offset = current_offset;
+                            auto it = mapped.begin();
+                            // breaks if row count exceeds batch_size
+                            for (; it.ok() && current_offset < _batch_size; 
++it) {
+                                if (LIKELY(current_offset < 
_build_block_rows.size())) {
+                                    _build_block_offsets[current_offset] = 
it->block_offset;
+                                    _build_block_rows[current_offset] = 
it->row_num;
+                                } else {
+                                    
_build_block_offsets.emplace_back(it->block_offset);
+                                    
_build_block_rows.emplace_back(it->row_num);
+                                }
+                                ++current_offset;
+                                visited_map.emplace_back(&it->visited);
+                            }
+                            probe_row_match_iter = it;
+                            // If all matched rows for the current probe row 
are handled,
+                            // advance to next probe row.
+                            if (!it.ok()) {
+                                ++probe_index;
+                            } else {
+                                // If not(which means it excceed batch size), 
probe_index is not increased and
+                                // remaining matched rows for the current 
probe row will be
+                                // handled in the next call of this function
+                                multi_matched_output_row_count =
+                                        current_offset - 
multi_match_last_offset;
+                            }
                         }
                     }
                     same_to_prev.emplace_back(false);
@@ -581,6 +616,20 @@ Status 
ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts(
                     }
                     ++current_offset;
                     ++probe_index;
+                } else if constexpr (JoinOpType == TJoinOp::LEFT_SEMI_JOIN) {
+                    if (is_mark_join) {
+                        same_to_prev.emplace_back(false);
+                        visited_map.emplace_back(nullptr);
+                        if (LIKELY(current_offset < _build_block_rows.size())) 
{
+                            _build_block_offsets[current_offset] = -1;
+                            _build_block_rows[current_offset] = -1;
+                        } else {
+                            _build_block_offsets.emplace_back(-1);
+                            _build_block_rows.emplace_back(-1);
+                        }
+                        ++current_offset;
+                    }
+                    ++probe_index;
                 } else {
                     // other join, no nothing
                     ++probe_index;
@@ -605,6 +654,7 @@ Status 
ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts(
             probe_side_output_column(mcol, 
_join_node->_left_output_slot_flags, current_offset,
                                      last_probe_index, probe_size, 
all_match_one, true);
         }
+        auto num_cols = mutable_block.columns();
         output_block->swap(mutable_block.to_block());
 
         // dispose the other join conjunct exec
@@ -688,6 +738,7 @@ Status 
ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts(
                             multi_matched_output_row_count, column, 
visited_map, right_col_idx,
                             right_col_len, null_map_data, filter_map, 
output_block);
                 }
+
                 for (size_t i = 0; i < row_count; ++i) {
                     if (filter_map[i]) {
                         
_tuple_is_null_right_flags->emplace_back(null_map_data[i]);
@@ -696,6 +747,7 @@ Status 
ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts(
                 output_block->get_by_position(result_column_id).column =
                         std::move(new_filter_column);
             } else if constexpr (JoinOpType == TJoinOp::LEFT_SEMI_JOIN) {
+                // TODO: resize in advance
                 auto new_filter_column = ColumnVector<UInt8>::create();
                 auto& filter_map = new_filter_column->get_data();
 
@@ -742,6 +794,24 @@ Status 
ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts(
                     }
                 }
 
+                if (is_mark_join) {
+                    auto& matched_map = 
assert_cast<doris::vectorized::ColumnVector<UInt8>&>(
+                                                
*(output_block->get_by_position(num_cols - 1)
+                                                          
.column->assume_mutable()))
+                                                .get_data();
+
+                    // For mark join, we only filter rows which have duplicate 
join keys.
+                    // And then, we set matched_map to the join result to do 
the mark join's filtering.
+                    for (size_t i = 1; i < row_count; ++i) {
+                        if (!same_to_prev[i]) {
+                            matched_map.push_back(filter_map[i - 1]);
+                            filter_map[i - 1] = true;
+                        }
+                    }
+                    matched_map.push_back(filter_map[filter_map.size() - 1]);
+                    filter_map[filter_map.size() - 1] = true;
+                }
+
                 output_block->get_by_position(result_column_id).column =
                         std::move(new_filter_column);
             } else if constexpr (JoinOpType == TJoinOp::LEFT_ANTI_JOIN ||
@@ -797,51 +867,67 @@ Status 
ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts(
                     }
                 }
 
-                int end_row_idx;
-                if (row_count_from_last_probe > 0) {
-                    end_row_idx = row_count - multi_matched_output_row_count;
-                    if (!_join_node->_is_any_probe_match_row_output) {
-                        // We are handling euqual-conjuncts matched tuples 
that are splitted into multiple blocks,
-                        // and no matched tuple has been output in all 
previous run.
-                        // If a tuple is output in this run, all the following 
mathced tuples should be ignored
-                        if (filter_map[row_count_from_last_probe - 1]) {
-                            _join_node->_is_any_probe_match_row_output = true;
-                            filter_map[row_count_from_last_probe - 1] = false;
-                        }
-                        if (is_the_last_sub_block && 
!_join_node->_is_any_probe_match_row_output) {
-                            // This is the last sub block of splitted block, 
and no equal-conjuncts-matched tuple
-                            // is output in all sub blocks, output a tuple for 
this probe row
-                            filter_map[0] = true;
+                if (is_mark_join) {
+                    auto& matched_map = 
assert_cast<doris::vectorized::ColumnVector<UInt8>&>(
+                                                
*(output_block->get_by_position(num_cols - 1)
+                                                          
.column->assume_mutable()))
+                                                .get_data();
+                    for (int i = 1; i < row_count; ++i) {
+                        if (!same_to_prev[i]) {
+                            matched_map.push_back(!filter_map[i - 1]);
+                            filter_map[i - 1] = true;
                         }
                     }
-                    if (multi_matched_output_row_count > 0) {
+                    matched_map.push_back(!filter_map[row_count - 1]);
+                    filter_map[row_count - 1] = true;
+                } else {
+                    int end_row_idx;
+                    if (row_count_from_last_probe > 0) {
+                        end_row_idx = row_count - 
multi_matched_output_row_count;
+                        if (!_join_node->_is_any_probe_match_row_output) {
+                            // We are handling euqual-conjuncts matched tuples 
that are splitted into multiple blocks,
+                            // and no matched tuple has been output in all 
previous run.
+                            // If a tuple is output in this run, all the 
following mathced tuples should be ignored
+                            if (filter_map[row_count_from_last_probe - 1]) {
+                                _join_node->_is_any_probe_match_row_output = 
true;
+                                filter_map[row_count_from_last_probe - 1] = 
false;
+                            }
+                            if (is_the_last_sub_block &&
+                                !_join_node->_is_any_probe_match_row_output) {
+                                // This is the last sub block of splitted 
block, and no equal-conjuncts-matched tuple
+                                // is output in all sub blocks, output a tuple 
for this probe row
+                                filter_map[0] = true;
+                            }
+                        }
+                        if (multi_matched_output_row_count > 0) {
+                            // It contains the first sub block of splited 
equal-conjuncts-matched tuples of the current probe row
+                            // If a matched row is output, all the 
equal-matched tuples in
+                            // the following sub blocks should be ignored
+                            _join_node->_is_any_probe_match_row_output = 
filter_map[row_count - 1];
+                            filter_map[row_count - 1] = false;
+                        }
+                    } else if (multi_matched_output_row_count > 0) {
+                        end_row_idx = row_count - 
multi_matched_output_row_count;
                         // It contains the first sub block of splited 
equal-conjuncts-matched tuples of the current probe row
                         // If a matched row is output, all the equal-matched 
tuples in
                         // the following sub blocks should be ignored
                         _join_node->_is_any_probe_match_row_output = 
filter_map[row_count - 1];
                         filter_map[row_count - 1] = false;
+                    } else {
+                        end_row_idx = row_count;
                     }
-                } else if (multi_matched_output_row_count > 0) {
-                    end_row_idx = row_count - multi_matched_output_row_count;
-                    // It contains the first sub block of splited 
equal-conjuncts-matched tuples of the current probe row
-                    // If a matched row is output, all the equal-matched 
tuples in
-                    // the following sub blocks should be ignored
-                    _join_node->_is_any_probe_match_row_output = 
filter_map[row_count - 1];
-                    filter_map[row_count - 1] = false;
-                } else {
-                    end_row_idx = row_count;
-                }
 
-                // Same to the semi join, but change the last value to 
opposite value
-                for (int i = 1 + row_count_from_last_probe; i < end_row_idx; 
++i) {
-                    if (!same_to_prev[i]) {
-                        filter_map[i - 1] = !filter_map[i - 1];
+                    // Same to the semi join, but change the last value to 
opposite value
+                    for (int i = 1 + row_count_from_last_probe; i < 
end_row_idx; ++i) {
+                        if (!same_to_prev[i]) {
+                            filter_map[i - 1] = !filter_map[i - 1];
+                        }
+                    }
+                    auto non_sub_blocks_matched_row_count =
+                            row_count - row_count_from_last_probe - 
multi_matched_output_row_count;
+                    if (non_sub_blocks_matched_row_count > 0) {
+                        filter_map[end_row_idx - 1] = !filter_map[end_row_idx 
- 1];
                     }
-                }
-                auto non_sub_blocks_matched_row_count =
-                        row_count - row_count_from_last_probe - 
multi_matched_output_row_count;
-                if (non_sub_blocks_matched_row_count > 0) {
-                    filter_map[end_row_idx - 1] = !filter_map[end_row_idx - 1];
                 }
 
                 output_block->get_by_position(result_column_id).column =
@@ -874,7 +960,11 @@ Status 
ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts(
                               JoinOpType == 
TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN) {
                     orig_columns = right_col_idx;
                 }
-                Block::filter_block(output_block, result_column_id, 
orig_columns);
+                if (is_mark_join) {
+                    Block::filter_block(output_block, result_column_id, 
output_block->columns());
+                } else {
+                    Block::filter_block(output_block, result_column_id, 
orig_columns);
+                }
             }
         }
 
@@ -1050,36 +1140,44 @@ struct ExtractType<T(U)> {
     template Status                                                            
               \
     ProcessHashTableProbe<JoinOpType>::do_process<false, false, 
ExtractType<void(T)>::Type>(  \
             ExtractType<void(T)>::Type & hash_table_ctx, ConstNullMapPtr 
null_map,            \
-            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows);           \
+            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows,            \
+            bool is_mark_join);                                                
               \
     template Status                                                            
               \
     ProcessHashTableProbe<JoinOpType>::do_process<false, true, 
ExtractType<void(T)>::Type>(   \
             ExtractType<void(T)>::Type & hash_table_ctx, ConstNullMapPtr 
null_map,            \
-            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows);           \
+            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows,            \
+            bool is_mark_join);                                                
               \
     template Status                                                            
               \
     ProcessHashTableProbe<JoinOpType>::do_process<true, false, 
ExtractType<void(T)>::Type>(   \
             ExtractType<void(T)>::Type & hash_table_ctx, ConstNullMapPtr 
null_map,            \
-            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows);           \
+            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows,            \
+            bool is_mark_join);                                                
               \
     template Status                                                            
               \
     ProcessHashTableProbe<JoinOpType>::do_process<true, true, 
ExtractType<void(T)>::Type>(    \
             ExtractType<void(T)>::Type & hash_table_ctx, ConstNullMapPtr 
null_map,            \
-            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows);           \
+            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows,            \
+            bool is_mark_join);                                                
               \
                                                                                
               \
     template Status 
ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts<  \
             false, false, ExtractType<void(T)>::Type>(                         
               \
             ExtractType<void(T)>::Type & hash_table_ctx, ConstNullMapPtr 
null_map,            \
-            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows);           \
+            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows,            \
+            bool is_mark_join);                                                
               \
     template Status 
ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts<  \
             false, true, ExtractType<void(T)>::Type>(                          
               \
             ExtractType<void(T)>::Type & hash_table_ctx, ConstNullMapPtr 
null_map,            \
-            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows);           \
+            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows,            \
+            bool is_mark_join);                                                
               \
     template Status 
ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts<  \
             true, false, ExtractType<void(T)>::Type>(                          
               \
             ExtractType<void(T)>::Type & hash_table_ctx, ConstNullMapPtr 
null_map,            \
-            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows);           \
+            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows,            \
+            bool is_mark_join);                                                
               \
     template Status 
ProcessHashTableProbe<JoinOpType>::do_process_with_other_join_conjuncts<  \
             true, true, ExtractType<void(T)>::Type>(                           
               \
             ExtractType<void(T)>::Type & hash_table_ctx, ConstNullMapPtr 
null_map,            \
-            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows);           \
+            MutableBlock & mutable_block, Block * output_block, size_t 
probe_rows,            \
+            bool is_mark_join);                                                
               \
                                                                                
               \
     template Status                                                            
               \
     
ProcessHashTableProbe<JoinOpType>::process_data_in_hashtable<ExtractType<void(T)>::Type>(
 \
diff --git a/be/src/vec/exec/join/vhash_join_node.cpp 
b/be/src/vec/exec/join/vhash_join_node.cpp
index 79f6bbf447..a5d1430c25 100644
--- a/be/src/vec/exec/join/vhash_join_node.cpp
+++ b/be/src/vec/exec/join/vhash_join_node.cpp
@@ -515,14 +515,15 @@ Status HashJoinNode::get_next(RuntimeState* state, Block* 
output_block, bool* eo
                                                      need_null_map_for_probe
                                                              ? 
&_null_map_column->get_data()
                                                              : nullptr,
-                                                     mutable_join_block, 
&temp_block, probe_rows);
+                                                     mutable_join_block, 
&temp_block, probe_rows,
+                                                     _is_mark_join);
                             } else {
                                 st = process_hashtable_ctx.template do_process<
                                         need_null_map_for_probe, ignore_null>(
                                         arg,
                                         need_null_map_for_probe ? 
&_null_map_column->get_data()
                                                                 : nullptr,
-                                        mutable_join_block, &temp_block, 
probe_rows);
+                                        mutable_join_block, &temp_block, 
probe_rows, _is_mark_join);
                             }
                         } else {
                             LOG(FATAL) << "FATAL: uninited hash table";
diff --git a/be/src/vec/exec/join/vhash_join_node.h 
b/be/src/vec/exec/join/vhash_join_node.h
index e7ee1feef0..97af3818b8 100644
--- a/be/src/vec/exec/join/vhash_join_node.h
+++ b/be/src/vec/exec/join/vhash_join_node.h
@@ -268,7 +268,6 @@ private:
 
     // for full/right outer join
     HashTableIteratorVariants _outer_join_pull_visited_iter;
-
     HashTableIteratorVariants _probe_row_match_iter;
 
     std::shared_ptr<std::vector<Block>> _build_blocks;
@@ -298,7 +297,6 @@ private:
 
     // for cases when a probe row matches more than batch size build rows.
     bool _is_any_probe_match_row_output = false;
-
     SharedHashTableContextPtr _shared_hash_table_context = nullptr;
 
     Status _materialize_build_side(RuntimeState* state) override;
diff --git a/be/src/vec/exec/join/vjoin_node_base.cpp 
b/be/src/vec/exec/join/vjoin_node_base.cpp
index 528854537b..d7f9c96c6a 100644
--- a/be/src/vec/exec/join/vjoin_node_base.cpp
+++ b/be/src/vec/exec/join/vjoin_node_base.cpp
@@ -52,7 +52,8 @@ VJoinNodeBase::VJoinNodeBase(ObjectPool* pool, const 
TPlanNode& tnode, const Des
                                 ? (tnode.nested_loop_join_node.__isset.is_mark
                                            ? 
tnode.nested_loop_join_node.is_mark
                                            : false)
-                                : false),
+                        : tnode.hash_join_node.__isset.is_mark ? 
tnode.hash_join_node.is_mark
+                                                               : false),
           _short_circuit_for_null_in_build_side(_join_op == 
TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN) {
     _init_join_op();
     if (_is_mark_join) {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
index 649f054e39..50a9fd7ce0 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java
@@ -394,6 +394,8 @@ public class Analyzer {
 
         private final Map<TableRef, TupleId> markTupleIdByInnerRef = 
Maps.newHashMap();
 
+        private final Set<TupleId> markTupleIdsNotProcessed = 
Sets.newHashSet();
+
         public GlobalState(Env env, ConnectContext context) {
             this.env = env;
             this.context = context;
@@ -653,12 +655,18 @@ public class Analyzer {
 
         tableRefMap.put(result.getId(), ref);
 
-        // for mark join
+        // for mark join, init three context
+        //   1. markTuples to records all tuples belong to mark slot
+        //   2. markTupleIdByInnerRef to records relationship between inner 
table of mark join and the mark tuple
+        //   3. markTupleIdsNotProcessed to records un-process mark tuple id. 
if an expr contains slot belong to
+        //        the un-process mark tuple, it should not assign to current 
join node and should pop up its
+        //        mark slot until all mark tuples in this expr has been 
processed.
         if (ref.getJoinOp() != null && ref.isMark()) {
             TupleDescriptor markTuple = getDescTbl().createTupleDescriptor();
             markTuple.setAliases(new String[]{ref.getMarkTupleName()}, true);
             globalState.markTuples.put(ref.getMarkTupleName(), markTuple);
             globalState.markTupleIdByInnerRef.put(ref, markTuple.getId());
+            globalState.markTupleIdsNotProcessed.add(markTuple.getId());
         }
 
         return result;
@@ -1570,12 +1578,38 @@ public class Analyzer {
         return result;
     }
 
+    public boolean needPopUpMarkTuple(TableRef ref) {
+        TupleId id = globalState.markTupleIdByInnerRef.get(ref);
+        if (id == null) {
+            return false;
+        }
+        List<Expr> exprs = getAllConjuncts(id);
+        for (Expr expr : exprs) {
+            List<TupleId> tupleIds = Lists.newArrayList();
+            expr.getIds(tupleIds, null);
+            if 
(tupleIds.stream().anyMatch(globalState.markTupleIdsNotProcessed::contains)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
     public List<Expr> getMarkConjuncts(TableRef ref) {
         TupleId id = globalState.markTupleIdByInnerRef.get(ref);
         if (id == null) {
             return Collections.emptyList();
         }
-        return getAllConjuncts(id);
+        globalState.markTupleIdsNotProcessed.remove(id);
+        List<Expr> retExprs = Lists.newArrayList();
+        List<Expr> exprs = getAllConjuncts(id);
+        for (Expr expr : exprs) {
+            List<TupleId> tupleIds = Lists.newArrayList();
+            expr.getIds(tupleIds, null);
+            if 
(tupleIds.stream().noneMatch(globalState.markTupleIdsNotProcessed::contains)) {
+                retExprs.add(expr);
+            }
+        }
+        return retExprs;
     }
 
     public TupleDescriptor getMarkTuple(TableRef ref) {
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/JoinOperator.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/JoinOperator.java
index 08c0321b25..a45835f3bd 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/JoinOperator.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/JoinOperator.java
@@ -97,6 +97,11 @@ public enum JoinOperator {
                 || this == JoinOperator.NULL_AWARE_LEFT_ANTI_JOIN;
     }
 
+    public boolean supportMarkJoin() {
+        return this == JoinOperator.LEFT_ANTI_JOIN || this == 
JoinOperator.LEFT_SEMI_JOIN
+                || this == JoinOperator.CROSS_JOIN || this == 
JoinOperator.NULL_AWARE_LEFT_ANTI_JOIN;
+    }
+
     public boolean isCrossJoin() {
         return this == CROSS_JOIN;
     }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/StmtRewriter.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/StmtRewriter.java
index a93c21692c..fd8a0710f7 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/StmtRewriter.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/StmtRewriter.java
@@ -365,10 +365,15 @@ public class StmtRewriter {
             List<Expr> subqueryExprInConjunct, List<Expr> 
subqueryExprInDisjunct) {
         if (!(expr instanceof CompoundPredicate)) {
             if (expr.contains(Subquery.class)) {
+                // remove redundant sub-query by compare two sub-query with 
equals
                 if (inDisjunct) {
-                    subqueryExprInDisjunct.add(expr);
+                    if (!subqueryExprInDisjunct.contains(expr)) {
+                        subqueryExprInDisjunct.add(expr);
+                    }
                 } else {
-                    subqueryExprInConjunct.add(expr);
+                    if (!subqueryExprInConjunct.contains(expr)) {
+                        subqueryExprInConjunct.add(expr);
+                    }
                 }
             }
         } else {
@@ -432,10 +437,12 @@ public class StmtRewriter {
      * ON $a$1.a = T1.a
      * WHERE T1.c < 10;
      */
-    // TODO(mark join) need support mark join
     private static void rewriteWhereClauseSubqueries(SelectStmt stmt, Analyzer 
analyzer)
             throws AnalysisException {
         int numTableRefs = stmt.fromClause.size();
+        // we must use two same set structs to process conjuncts and disjuncts
+        // because the same sub-query could appear in both at the same time.
+        // if we use one ExprSubstitutionMap, the sub-query will be replaced 
by wrong expr.
         ArrayList<Expr> exprsWithSubqueriesInConjuncts = Lists.newArrayList();
         ArrayList<Expr> exprsWithSubqueriesInDisjuncts = Lists.newArrayList();
         ExprSubstitutionMap conjunctsSmap = new ExprSubstitutionMap();
@@ -445,7 +452,6 @@ public class StmtRewriter {
         List<Expr> subqueryInDisjunct = Lists.newArrayList();
         // Check if all the conjuncts in the WHERE clause that contain 
subqueries
         // can currently be rewritten as a join.
-        // TODO(mark join) traverse expr tree to process subquery.
         extractExprWithSubquery(false, stmt.whereClause, subqueryInConjunct, 
subqueryInDisjunct);
         for (Expr conjunct : subqueryInConjunct) {
             processOneSubquery(stmt, exprsWithSubqueriesInConjuncts,
@@ -458,8 +464,7 @@ public class StmtRewriter {
         stmt.whereClause = stmt.whereClause.substitute(conjunctsSmap, 
disjunctsSmap, analyzer, false);
 
         boolean hasNewVisibleTuple = false;
-        // Recursively equal all the exprs that contain subqueries and merge 
them
-        // with 'stmt'.
+        // Recursively equal all the exprs that contain subqueries and merge 
them with 'stmt'.
         for (Expr expr : exprsWithSubqueriesInConjuncts) {
             if (mergeExpr(stmt, rewriteExpr(expr, analyzer), analyzer, null)) {
                 hasNewVisibleTuple = true;
@@ -515,7 +520,6 @@ public class StmtRewriter {
         // Replace all the supported exprs with subqueries with true 
BoolLiterals
         // using a smap.
         if (isMark) {
-            // TODO(mark join) if need mark join, we should replace a SlotRef 
instead of BoolLiteral
             TupleDescriptor markTuple = 
analyzer.getDescTbl().createTupleDescriptor();
             markTuple.setAliases(new 
String[]{stmt.getTableAliasGenerator().getNextAlias()}, true);
             SlotDescriptor markSlot = analyzer.addSlotDescriptor(markTuple);
@@ -840,9 +844,6 @@ public class StmtRewriter {
                 && ((ExistsPredicate) expr).isNotExists()) {
             // For the case of a NOT IN with an eq join conjunct, replace the 
join
             // conjunct with a conjunct that uses the null-matching eq 
operator.
-            // TODO: mark join only works on nested loop join now, and NLJ do 
NOT support NULL_AWARE_LEFT_ANTI_JOIN
-            //     remove markTuple == null when nested loop join support 
NULL_AWARE_LEFT_ANTI_JOIN
-            //     or plan mark join on hash join
             if (expr instanceof InPredicate && markTuple == null) {
                 joinOp = VectorizedUtil.isVectorized()
                         ? JoinOperator.NULL_AWARE_LEFT_ANTI_JOIN : 
JoinOperator.LEFT_ANTI_JOIN;
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/TableRef.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/TableRef.java
index f2b138b636..cc36f45ec5 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/TableRef.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/TableRef.java
@@ -94,8 +94,11 @@ public class TableRef implements ParseNode, Writable {
     // Indicates whether this table ref is given an explicit alias,
     protected boolean hasExplicitAlias;
     protected JoinOperator joinOp;
+    // for mark join
     protected boolean isMark;
+    // we must record mark tuple name for re-analyze
     protected String markTupleName;
+
     protected List<String> usingColNames;
     protected ArrayList<LateralViewRef> lateralViewRefs;
     protected Expr onClause;
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/HashJoinNode.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/HashJoinNode.java
index a48778bccd..2fc14357a9 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/HashJoinNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/HashJoinNode.java
@@ -706,6 +706,7 @@ public class HashJoinNode extends JoinNodeBase {
         msg.hash_join_node = new THashJoinNode();
         msg.hash_join_node.join_op = joinOp.toThrift();
         msg.hash_join_node.setIsBroadcastJoin(distrMode == 
DistributionMode.BROADCAST);
+        msg.hash_join_node.setIsMark(isMarkJoin());
         for (BinaryPredicate eqJoinPredicate : eqJoinConjuncts) {
             TEqJoinCondition eqJoinCondition = new 
TEqJoinCondition(eqJoinPredicate.getChild(0).treeToThrift(),
                     eqJoinPredicate.getChild(1).treeToThrift());
@@ -757,7 +758,7 @@ public class HashJoinNode extends JoinNodeBase {
         StringBuilder output =
                 new StringBuilder().append(detailPrefix).append("join op: 
").append(joinOp.toString()).append("(")
                         
.append(distrModeStr).append(")").append("[").append(colocateReason).append("]\n");
-
+        output.append(detailPrefix).append("is mark: 
").append(isMarkJoin()).append("\n");
         if (detailLevel == TExplainLevel.BRIEF) {
             output.append(detailPrefix).append(
                     String.format("cardinality=%,d", 
cardinality)).append("\n");
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/JoinNodeBase.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/JoinNodeBase.java
index 963a4feda0..cfa2865d2a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/JoinNodeBase.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/JoinNodeBase.java
@@ -87,6 +87,10 @@ public abstract class JoinNodeBase extends PlanNode {
         }
     }
 
+    public boolean isMarkJoin() {
+        return innerRef != null && innerRef.isMark();
+    }
+
     public JoinOperator getJoinOp() {
         return joinOp;
     }
@@ -110,7 +114,6 @@ public abstract class JoinNodeBase extends PlanNode {
     }
 
     protected void computeOutputTuple(Analyzer analyzer) throws UserException {
-        // TODO(mark join) if it is mark join use mark tuple instead?
         // 1. create new tuple
         vOutputTupleDesc = analyzer.getDescTbl().createTupleDescriptor();
         boolean copyLeft = false;
@@ -204,6 +207,15 @@ public abstract class JoinNodeBase extends PlanNode {
                 }
             }
         }
+
+        // add mark slot if needed
+        if (isMarkJoin() && analyzer.needPopUpMarkTuple(innerRef)) {
+            SlotDescriptor markSlot = 
analyzer.getMarkTuple(innerRef).getSlots().get(0);
+            SlotDescriptor outputSlotDesc =
+                    analyzer.getDescTbl().copySlotDescriptor(vOutputTupleDesc, 
markSlot);
+            srcTblRefToOutputTupleSmap.put(new SlotRef(markSlot), new 
SlotRef(outputSlotDesc));
+        }
+
         // 2. compute srcToOutputMap
         vSrcToOutputSMap = ExprSubstitutionMap.subtraction(outputSmap, 
srcTblRefToOutputTupleSmap, analyzer);
         for (int i = 0; i < vSrcToOutputSMap.size(); i++) {
@@ -216,6 +228,7 @@ public abstract class JoinNodeBase extends PlanNode {
                 rSlotRef.getDesc().setIsMaterialized(true);
             }
         }
+
         vOutputTupleDesc.computeStatAndMemLayout();
         // 3. add tupleisnull in null-side
         Preconditions.checkState(srcTblRefToOutputTupleSmap.getLhs().size() == 
vSrcToOutputSMap.getLhs().size());
@@ -309,7 +322,7 @@ public abstract class JoinNodeBase extends PlanNode {
     }
 
     @Override
-    public void projectOutputTuple() throws NotImplementedException {
+    public void projectOutputTuple() {
         if (vOutputTupleDesc == null) {
             return;
         }
@@ -339,15 +352,19 @@ public abstract class JoinNodeBase extends PlanNode {
 
     protected abstract void computeOtherConjuncts(Analyzer analyzer, 
ExprSubstitutionMap originToIntermediateSmap);
 
-    protected void computeIntermediateTuple(Analyzer analyzer, TupleDescriptor 
markTuple) throws AnalysisException {
+    protected void computeIntermediateTuple(Analyzer analyzer) throws 
AnalysisException {
         // 1. create new tuple
         TupleDescriptor vIntermediateLeftTupleDesc = 
analyzer.getDescTbl().createTupleDescriptor();
         TupleDescriptor vIntermediateRightTupleDesc = 
analyzer.getDescTbl().createTupleDescriptor();
         vIntermediateTupleDescList = new ArrayList<>();
         vIntermediateTupleDescList.add(vIntermediateLeftTupleDesc);
         vIntermediateTupleDescList.add(vIntermediateRightTupleDesc);
-        if (markTuple != null) {
-            vIntermediateTupleDescList.add(markTuple);
+        // if join type is MARK, add mark tuple to intermediate tuple. mark 
slot will be generated after join.
+        if (isMarkJoin()) {
+            TupleDescriptor markTuple = analyzer.getMarkTuple(innerRef);
+            if (markTuple != null) {
+                vIntermediateTupleDescList.add(markTuple);
+            }
         }
         boolean leftNullable = false;
         boolean rightNullable = false;
@@ -450,11 +467,7 @@ public abstract class JoinNodeBase extends PlanNode {
     public void finalize(Analyzer analyzer) throws UserException {
         super.finalize(analyzer);
         if (VectorizedUtil.isVectorized()) {
-            TupleDescriptor markTuple = null;
-            if (innerRef != null) {
-                markTuple = analyzer.getMarkTuple(innerRef);
-            }
-            computeIntermediateTuple(analyzer, markTuple);
+            computeIntermediateTuple(analyzer);
         }
     }
 
@@ -479,6 +492,10 @@ public abstract class JoinNodeBase extends PlanNode {
         // so need replace the outsmap in nullableTupleID
         replaceOutputSmapForOuterJoin();
         computeStats(analyzer);
+
+        if (isMarkJoin() && !joinOp.supportMarkJoin()) {
+            throw new UserException("Mark join is supported only for LEFT SEMI 
JOIN/LEFT ANTI JOIN/CROSS JOIN");
+        }
     }
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/NestedLoopJoinNode.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/NestedLoopJoinNode.java
index 6adb64cd4b..89c83df1fa 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/NestedLoopJoinNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/NestedLoopJoinNode.java
@@ -176,7 +176,7 @@ public class NestedLoopJoinNode extends JoinNodeBase {
         if (vJoinConjunct != null) {
             
msg.nested_loop_join_node.setVjoinConjunct(vJoinConjunct.treeToThrift());
         }
-        msg.nested_loop_join_node.setIsMark(innerRef != null && 
innerRef.isMark());
+        msg.nested_loop_join_node.setIsMark(isMarkJoin());
         if (vSrcToOutputSMap != null) {
             for (int i = 0; i < vSrcToOutputSMap.size(); i++) {
                 // TODO: Enable it after we support new optimizers
@@ -228,6 +228,7 @@ public class NestedLoopJoinNode extends JoinNodeBase {
         StringBuilder output =
                 new StringBuilder().append(detailPrefix).append("join op: 
").append(joinOp.toString()).append("(")
                         .append(distrModeStr).append(")\n");
+        output.append(detailPrefix).append("is mark: 
").append(isMarkJoin()).append("\n");
 
         if (detailLevel == TExplainLevel.BRIEF) {
             output.append(detailPrefix).append(
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilterGenerator.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilterGenerator.java
index a0c66c8b93..7da0f94afa 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilterGenerator.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilterGenerator.java
@@ -221,7 +221,7 @@ public final class RuntimeFilterGenerator {
      * (scan) nodes. Filters that cannot be assigned to a scan node are 
discarded.
      */
     private void generateFilters(PlanNode root) {
-        if (root instanceof HashJoinNode) {
+        if (root instanceof HashJoinNode && !((HashJoinNode) 
root).isMarkJoin()) {
             HashJoinNode joinNode = (HashJoinNode) root;
             List<Expr> joinConjuncts = new ArrayList<>();
             // It's not correct to push runtime filters to the left side of a 
left outer,
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
index bd056275a5..2d431c3bb5 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
@@ -2063,7 +2063,7 @@ public class SingleNodePlanner {
             ojConjuncts = 
analyzer.getUnassignedSemiAntiJoinNoNullAwareConjuncts(innerRef);
         }
         analyzer.markConjunctsAssigned(ojConjuncts);
-        if (eqJoinConjuncts.isEmpty() || innerRef.isMark()) {
+        if (eqJoinConjuncts.isEmpty()) {
             NestedLoopJoinNode result =
                     new NestedLoopJoinNode(ctx.getNextNodeId(), outer, inner, 
innerRef);
             List<Expr> joinConjuncts = Lists.newArrayList(eqJoinConjuncts);
diff --git a/gensrc/thrift/PlanNodes.thrift b/gensrc/thrift/PlanNodes.thrift
index 35ebab6373..f01b0f6144 100644
--- a/gensrc/thrift/PlanNodes.thrift
+++ b/gensrc/thrift/PlanNodes.thrift
@@ -626,7 +626,9 @@ struct THashJoinNode {
 
   9: optional list<Types.TTupleId> vintermediate_tuple_id_list
 
-  10: optional bool is_broadcast_join;
+  10: optional bool is_broadcast_join
+
+  11: optional bool is_mark
 }
 
 struct TNestedLoopJoinNode {
diff --git a/regression-test/data/correctness/test_subquery_in_disjunction.out 
b/regression-test/data/correctness/test_subquery_in_disjunction.out
index 4259f027ea..98dcd6e439 100644
--- a/regression-test/data/correctness/test_subquery_in_disjunction.out
+++ b/regression-test/data/correctness/test_subquery_in_disjunction.out
@@ -24,3 +24,45 @@
 1      2       3
 100    200     300
 
+-- !hash_join_with_other_conjuncts1 --
+1      2       3
+
+-- !hash_join_with_other_conjuncts2 --
+1      2       3
+10     20      30
+
+-- !hash_join_with_other_conjuncts3 --
+1      2       3
+10     20      30
+
+-- !hash_join_with_other_conjuncts4 --
+1      2       3
+10     20      30
+
+-- !hash_join_with_other_conjuncts5 --
+1      2       3
+10     20      30
+100    200     300
+
+-- !hash_join_with_other_conjuncts6 --
+1      2       3
+100    200     300
+
+-- !hash_join_with_other_conjuncts7 --
+1      2       3
+10     20      30
+100    200     300
+
+-- !hash_join_with_other_conjuncts8 --
+1      2       3
+10     20      30
+100    200     300
+
+-- !same_subquery_in_conjuncts --
+1      2       3
+10     20      30
+
+-- !two_subquery_in_one_conjuncts --
+1      2       3
+10     20      30
+
diff --git 
a/regression-test/data/correctness_p0/test_left_anti_join_batch_size.out 
b/regression-test/data/correctness_p0/test_left_anti_join_batch_size.out
new file mode 100644
index 0000000000..daf635f191
--- /dev/null
+++ b/regression-test/data/correctness_p0/test_left_anti_join_batch_size.out
@@ -0,0 +1,606 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !test_left_anti_join_batch_size --
+2      138
+4      579
+36     978
+64     597
+66     350
+99     95
+128    944
+132    907
+160    982
+161    62
+162    466
+193    192
+196    237
+199    998
+227    213
+228    655
+257    624
+259    879
+288    723
+292    926
+293    642
+327    144
+352    378
+353    223
+355    381
+385    912
+389    199
+391    684
+416    871
+421    308
+422    962
+423    716
+452    465
+454    544
+485    479
+546    234
+550    301
+578    240
+609    811
+642    364
+674    398
+705    406
+706    933
+707    520
+742    262
+743    685
+769    775
+805    919
+806    506
+834    197
+835    994
+837    913
+838    635
+866    572
+867    881
+870    674
+934    313
+965    205
+992    757
+996    775
+997    745
+1030   209
+1063   24
+1088   445
+1091   725
+1095   873
+1123   872
+1186   247
+1187   983
+1189   69
+1190   154
+1191   84
+1217   426
+1219   123
+1222   130
+1223   947
+1249   327
+1313   903
+1314   452
+1344   526
+1348   824
+1349   327
+1351   724
+1376   120
+1380   609
+1383   98
+1414   485
+1415   825
+1440   761
+1442   13
+1443   622
+1446   188
+1479   147
+1507   223
+1511   495
+1541   595
+1570   19
+1602   282
+1603   778
+1605   856
+1639   573
+1664   254
+1665   404
+1669   839
+1670   139
+1699   242
+1729   696
+1734   35
+1765   58
+1796   21
+1799   372
+1824   751
+1830   360
+1831   705
+1860   296
+1862   216
+1863   227
+1892   540
+1894   831
+1895   819
+1921   84
+1922   479
+1952   697
+1953   549
+1959   869
+1984   512
+1987   256
+1989   739
+2016   37
+2017   9
+2019   697
+2021   246
+2048   55
+2054   100
+2080   437
+2085   275
+2112   11
+2114   45
+2119   697
+2147   858
+2148   378
+2182   595
+2212   596
+2243   700
+2244   520
+2247   461
+2274   574
+2308   753
+2310   44
+2336   487
+2337   735
+2338   617
+2340   569
+2341   552
+2343   991
+2369   141
+2401   724
+2402   929
+2405   374
+2432   181
+2436   408
+2471   386
+2501   446
+2502   217
+2535   342
+2564   123
+2592   339
+2596   748
+2597   896
+2626   901
+2627   849
+2631   429
+2660   534
+2663   107
+2693   186
+2726   567
+2727   624
+2755   505
+2787   8
+2822   343
+2848   998
+2849   231
+2851   11
+2852   140
+2882   864
+2887   416
+2912   670
+2916   510
+2918   257
+2947   997
+2948   172
+2951   410
+2977   746
+2981   105
+3011   30
+3042   243
+3047   401
+3074   171
+3075   373
+3076   48
+3078   974
+3137   269
+3139   185
+3141   687
+3142   446
+3173   241
+3206   321
+3237   324
+3238   269
+3266   831
+3267   234
+3268   569
+3299   54
+3301   167
+3302   792
+3329   53
+3330   413
+3332   387
+3361   537
+3395   295
+3398   297
+3424   892
+3431   725
+3456   563
+3493   770
+3495   861
+3524   824
+3525   698
+3526   15
+3527   266
+3559   961
+3589   412
+3616   925
+3620   191
+3622   477
+3651   564
+3680   757
+3681   785
+3718   725
+3744   15
+3746   403
+3776   934
+3779   337
+3875   534
+3877   786
+3879   94
+3908   444
+3938   368
+3972   810
+3974   615
+3975   371
+4005   717
+4037   678
+4098   943
+4100   364
+4103   989
+4132   4
+4133   366
+4160   430
+4163   288
+4164   489
+4194   167
+4225   761
+4226   976
+4256   305
+4259   769
+4260   97
+4289   563
+4294   281
+4323   37
+4325   757
+4326   274
+4352   840
+4353   141
+4358   28
+4385   623
+4391   367
+4417   610
+4419   418
+4420   483
+4423   717
+4449   329
+4451   230
+4480   570
+4481   645
+4482   38
+4487   808
+4517   255
+4519   277
+4546   774
+4549   62
+4550   169
+4576   792
+4581   477
+4612   230
+4615   390
+4641   785
+4643   299
+4679   451
+4709   435
+4737   822
+4772   684
+4775   656
+4800   55
+4802   946
+4838   181
+4867   231
+4898   675
+4903   760
+4928   290
+4963   317
+4993   119
+5025   262
+5026   796
+5027   39
+5029   361
+5058   514
+5091   504
+5123   576
+5125   909
+5154   247
+5155   658
+5156   231
+5187   852
+5188   16
+5219   491
+5220   790
+5222   844
+5248   800
+5250   962
+5251   424
+5255   916
+5283   168
+5287   334
+5312   854
+5351   111
+5378   622
+5379   149
+5412   819
+5440   933
+5447   114
+5508   479
+5510   684
+5539   210
+5542   826
+5602   335
+5607   418
+5638   785
+5639   170
+5667   237
+5700   506
+5701   605
+5728   675
+5730   970
+5764   64
+5795   839
+5796   309
+5825   88
+5830   723
+5860   783
+5861   79
+5862   469
+5863   203
+5888   899
+5890   224
+5891   473
+5893   161
+5952   35
+5953   98
+5955   465
+5985   831
+5988   733
+5991   30
+6052   782
+6054   499
+6080   182
+6114   902
+6149   546
+6151   458
+6176   472
+6177   904
+6178   433
+6180   716
+6212   989
+6213   174
+6214   744
+6245   892
+6247   552
+6273   257
+6277   468
+6306   19
+6308   807
+6336   467
+6368   267
+6400   223
+6405   315
+6407   763
+6434   14
+6436   163
+6466   289
+6467   221
+6468   670
+6497   793
+6530   573
+6534   745
+6595   533
+6597   313
+6598   602
+6624   275
+6658   209
+6692   474
+6694   474
+6720   888
+6752   558
+6758   258
+6785   232
+6787   47
+6791   516
+6816   172
+6853   118
+6855   489
+6880   785
+6912   573
+6914   494
+6946   680
+6950   26
+6951   963
+6979   701
+6983   922
+7008   470
+7009   362
+7072   753
+7074   520
+7076   680
+7104   387
+7108   999
+7110   162
+7111   171
+7143   528
+7172   505
+7174   369
+7175   216
+7201   78
+7203   83
+7206   986
+7232   564
+7233   482
+7234   607
+7239   234
+7264   44
+7301   679
+7302   887
+7360   20
+7397   9
+7424   335
+7426   518
+7428   914
+7430   999
+7431   755
+7456   530
+7457   703
+7459   137
+7460   246
+7489   247
+7495   334
+7525   3
+7556   580
+7557   694
+7587   878
+7616   342
+7619   839
+7620   470
+7648   85
+7650   681
+7651   620
+7652   630
+7655   227
+7681   294
+7713   308
+7716   635
+7748   754
+7749   174
+7809   281
+7815   687
+7875   237
+7876   434
+7909   212
+7937   324
+7941   144
+7970   292
+7975   81
+8039   186
+8067   683
+8069   900
+8161   544
+8192   737
+8194   309
+8197   815
+8228   71
+8289   282
+8325   842
+8326   14
+8327   860
+8352   342
+8356   662
+8386   302
+8420   882
+8483   148
+8485   595
+8544   134
+8580   287
+8613   542
+8615   530
+8640   523
+8647   779
+8675   970
+8677   863
+8679   648
+8772   377
+8773   191
+8775   593
+8800   693
+8832   438
+8839   237
+8864   315
+8870   677
+8871   621
+8897   203
+8898   389
+8901   370
+8902   4
+8903   46
+8928   1000
+8930   506
+8962   362
+8965   559
+8967   833
+8998   562
+9027   567
+9028   87
+9029   764
+9058   816
+9063   295
+9090   924
+9093   999
+9095   982
+9121   582
+9127   969
+9152   352
+9153   806
+9157   464
+9158   429
+9159   350
+9185   401
+9191   620
+9218   240
+9220   507
+9249   23
+9251   281
+9282   209
+9283   244
+9285   441
+9287   84
+9315   369
+9317   547
+9318   902
+9350   474
+9377   176
+9379   181
+9382   789
+9411   259
+9440   200
+9444   328
+9447   239
+9477   468
+9506   229
+9507   360
+9537   366
+9539   95
+9540   785
+9575   500
+9605   511
+9636   66
+9668   168
+9699   298
+9731   668
+9732   779
+9734   271
+9761   168
+9767   995
+9827   994
+9856   386
+9858   219
+9889   619
+9890   127
+9891   122
+9893   721
+9952   234
+9953   533
+9956   941
+9959   988
+9985   496
+9986   168
+9988   831
diff --git a/regression-test/data/tpcds_sf1_p1/sql/q10.out 
b/regression-test/data/tpcds_sf1_p1/sql/q10.out
new file mode 100644
index 0000000000..c406a1ffdb
--- /dev/null
+++ b/regression-test/data/tpcds_sf1_p1/sql/q10.out
@@ -0,0 +1,8 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !q10 --
+F      D       Advanced Degree 1       3000    1       High Risk       1       
2       1       4       1       5       1
+F      D       Unknown 1       1500    1       Good    1       6       1       
5       1       4       1
+M      D       College 1       8500    1       Low Risk        1       3       
1       0       1       1       1
+M      D       Primary 1       7000    1       Unknown 1       2       1       
1       1       1       1
+M      W       Unknown 1       4500    1       Good    1       5       1       
0       1       1       1
+
diff --git a/regression-test/data/tpcds_sf1_p1/sql/q35.out 
b/regression-test/data/tpcds_sf1_p1/sql/q35.out
new file mode 100644
index 0000000000..c75651704c
--- /dev/null
+++ b/regression-test/data/tpcds_sf1_p1/sql/q35.out
@@ -0,0 +1,103 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !q35 --
+       F       D       0       1       0       0       0.0     1       1       
1       1       1.0     2       1       2       2       2.0
+       F       D       0       1       0       0       0.0     3       1       
3       3       3.0     0       1       0       0       0.0
+       F       D       0       1       0       0       0.0     5       1       
5       5       5.0     0       1       0       0       0.0
+       F       D       0       1       0       0       0.0     6       1       
6       6       6.0     0       1       0       0       0.0
+       F       D       1       1       1       1       1.0     1       1       
1       1       1.0     1       1       1       1       1.0
+       F       D       1       1       1       1       1.0     5       1       
5       5       5.0     3       1       3       3       3.0
+       F       D       3       1       3       3       3.0     0       1       
0       0       0.0     5       1       5       5       5.0
+       F       D       3       1       3       3       3.0     1       1       
1       1       1.0     3       1       3       3       3.0
+       F       D       3       1       3       3       3.0     5       1       
5       5       5.0     4       1       4       4       4.0
+       F       D       4       1       4       4       4.0     2       1       
2       2       2.0     5       1       5       5       5.0
+       F       D       4       1       4       4       4.0     4       1       
4       4       4.0     4       1       4       4       4.0
+       F       D       6       1       6       6       6.0     0       1       
0       0       0.0     6       1       6       6       6.0
+       F       D       6       1       6       6       6.0     5       1       
5       5       5.0     4       1       4       4       4.0
+       F       M       0       1       0       0       0.0     0       1       
0       0       0.0     3       1       3       3       3.0
+       F       M       0       1       0       0       0.0     3       1       
3       3       3.0     6       1       6       6       6.0
+       F       M       1       2       1       1       1.0     1       2       
1       1       1.0     0       2       0       0       0.0
+       F       M       1       1       1       1       1.0     2       1       
2       2       2.0     4       1       4       4       4.0
+       F       M       1       1       1       1       1.0     3       1       
3       3       3.0     3       1       3       3       3.0
+       F       M       1       1       1       1       1.0     4       1       
4       4       4.0     2       1       2       2       2.0
+       F       M       1       1       1       1       1.0     6       1       
6       6       6.0     2       1       2       2       2.0
+       F       M       2       1       2       2       2.0     1       1       
1       1       1.0     0       1       0       0       0.0
+       F       M       2       1       2       2       2.0     5       1       
5       5       5.0     4       1       4       4       4.0
+       F       M       3       1       3       3       3.0     0       1       
0       0       0.0     4       1       4       4       4.0
+       F       M       4       1       4       4       4.0     2       1       
2       2       2.0     1       1       1       1       1.0
+       F       M       4       1       4       4       4.0     4       1       
4       4       4.0     1       1       1       1       1.0
+       F       M       5       1       5       5       5.0     1       1       
1       1       1.0     2       1       2       2       2.0
+       F       M       5       1       5       5       5.0     3       1       
3       3       3.0     3       1       3       3       3.0
+       F       M       6       1       6       6       6.0     2       1       
2       2       2.0     2       1       2       2       2.0
+       F       M       6       1       6       6       6.0     2       1       
2       2       2.0     3       1       3       3       3.0
+       F       M       6       1       6       6       6.0     3       1       
3       3       3.0     4       1       4       4       4.0
+       F       M       6       1       6       6       6.0     5       1       
5       5       5.0     1       1       1       1       1.0
+       F       S       0       1       0       0       0.0     0       1       
0       0       0.0     3       1       3       3       3.0
+       F       S       0       1       0       0       0.0     2       1       
2       2       2.0     3       1       3       3       3.0
+       F       S       0       1       0       0       0.0     3       1       
3       3       3.0     6       1       6       6       6.0
+       F       S       0       1       0       0       0.0     4       1       
4       4       4.0     5       1       5       5       5.0
+       F       S       1       1       1       1       1.0     0       1       
0       0       0.0     3       1       3       3       3.0
+       F       S       1       1       1       1       1.0     3       1       
3       3       3.0     4       1       4       4       4.0
+       F       S       1       1       1       1       1.0     4       1       
4       4       4.0     0       1       0       0       0.0
+       F       S       1       1       1       1       1.0     4       1       
4       4       4.0     4       1       4       4       4.0
+       F       S       1       1       1       1       1.0     5       1       
5       5       5.0     0       1       0       0       0.0
+       F       S       2       1       2       2       2.0     0       1       
0       0       0.0     3       1       3       3       3.0
+       F       S       2       1       2       2       2.0     1       1       
1       1       1.0     6       1       6       6       6.0
+       F       S       2       1       2       2       2.0     2       1       
2       2       2.0     2       1       2       2       2.0
+       F       S       2       1       2       2       2.0     4       1       
4       4       4.0     6       1       6       6       6.0
+       F       S       2       1       2       2       2.0     6       1       
6       6       6.0     1       1       1       1       1.0
+       F       S       2       1       2       2       2.0     6       1       
6       6       6.0     5       1       5       5       5.0
+       F       S       3       1       3       3       3.0     1       1       
1       1       1.0     0       1       0       0       0.0
+       F       S       3       1       3       3       3.0     1       1       
1       1       1.0     2       1       2       2       2.0
+       F       S       3       1       3       3       3.0     3       1       
3       3       3.0     0       1       0       0       0.0
+       F       S       3       1       3       3       3.0     4       1       
4       4       4.0     6       1       6       6       6.0
+       F       S       3       1       3       3       3.0     6       1       
6       6       6.0     6       1       6       6       6.0
+       F       S       4       1       4       4       4.0     0       1       
0       0       0.0     2       1       2       2       2.0
+       F       S       5       1       5       5       5.0     4       1       
4       4       4.0     2       1       2       2       2.0
+       F       S       5       1       5       5       5.0     6       1       
6       6       6.0     6       1       6       6       6.0
+       F       S       6       1       6       6       6.0     0       1       
0       0       0.0     0       1       0       0       0.0
+       F       S       6       1       6       6       6.0     0       1       
0       0       0.0     2       1       2       2       2.0
+       F       S       6       1       6       6       6.0     4       1       
4       4       4.0     5       1       5       5       5.0
+       F       U       0       1       0       0       0.0     4       1       
4       4       4.0     1       1       1       1       1.0
+       F       U       0       1       0       0       0.0     5       1       
5       5       5.0     1       1       1       1       1.0
+       F       U       0       1       0       0       0.0     6       1       
6       6       6.0     6       1       6       6       6.0
+       F       U       1       1       1       1       1.0     5       1       
5       5       5.0     2       1       2       2       2.0
+       F       U       2       1       2       2       2.0     4       1       
4       4       4.0     4       1       4       4       4.0
+       F       U       3       1       3       3       3.0     1       1       
1       1       1.0     6       1       6       6       6.0
+       F       U       3       1       3       3       3.0     3       1       
3       3       3.0     6       1       6       6       6.0
+       F       U       3       1       3       3       3.0     4       1       
4       4       4.0     3       1       3       3       3.0
+       F       U       3       1       3       3       3.0     5       1       
5       5       5.0     1       1       1       1       1.0
+       F       U       3       1       3       3       3.0     6       1       
6       6       6.0     0       1       0       0       0.0
+       F       U       3       1       3       3       3.0     6       1       
6       6       6.0     3       1       3       3       3.0
+       F       U       6       1       6       6       6.0     1       1       
1       1       1.0     3       1       3       3       3.0
+       F       U       6       1       6       6       6.0     2       1       
2       2       2.0     1       1       1       1       1.0
+       F       U       6       1       6       6       6.0     5       1       
5       5       5.0     6       1       6       6       6.0
+       F       W       0       1       0       0       0.0     2       1       
2       2       2.0     4       1       4       4       4.0
+       F       W       0       1       0       0       0.0     6       1       
6       6       6.0     2       1       2       2       2.0
+       F       W       2       1       2       2       2.0     5       1       
5       5       5.0     1       1       1       1       1.0
+       F       W       4       1       4       4       4.0     0       1       
0       0       0.0     4       1       4       4       4.0
+       F       W       4       1       4       4       4.0     1       1       
1       1       1.0     1       1       1       1       1.0
+       F       W       4       1       4       4       4.0     2       1       
2       2       2.0     6       1       6       6       6.0
+       F       W       4       1       4       4       4.0     4       1       
4       4       4.0     3       1       3       3       3.0
+       F       W       5       1       5       5       5.0     6       1       
6       6       6.0     1       1       1       1       1.0
+       F       W       6       1       6       6       6.0     2       1       
2       2       2.0     6       1       6       6       6.0
+       F       W       6       1       6       6       6.0     3       1       
3       3       3.0     4       1       4       4       4.0
+       F       W       6       1       6       6       6.0     4       1       
4       4       4.0     0       1       0       0       0.0
+       F       W       6       1       6       6       6.0     5       1       
5       5       5.0     6       1       6       6       6.0
+       M       D       1       1       1       1       1.0     5       1       
5       5       5.0     6       1       6       6       6.0
+       M       D       2       1       2       2       2.0     3       1       
3       3       3.0     3       1       3       3       3.0
+       M       D       2       1       2       2       2.0     6       1       
6       6       6.0     1       1       1       1       1.0
+       M       D       2       1       2       2       2.0     6       1       
6       6       6.0     6       1       6       6       6.0
+       M       D       3       1       3       3       3.0     5       1       
5       5       5.0     4       1       4       4       4.0
+       M       D       3       1       3       3       3.0     6       1       
6       6       6.0     6       1       6       6       6.0
+       M       D       4       1       4       4       4.0     5       1       
5       5       5.0     5       1       5       5       5.0
+       M       D       6       1       6       6       6.0     1       1       
1       1       1.0     1       1       1       1       1.0
+       M       D       6       1       6       6       6.0     2       1       
2       2       2.0     5       1       5       5       5.0
+       M       D       6       1       6       6       6.0     4       1       
4       4       4.0     3       1       3       3       3.0
+       M       D       6       1       6       6       6.0     4       1       
4       4       4.0     4       1       4       4       4.0
+       M       M       0       1       0       0       0.0     0       1       
0       0       0.0     2       1       2       2       2.0
+       M       M       0       1       0       0       0.0     1       1       
1       1       1.0     6       1       6       6       6.0
+       M       M       0       1       0       0       0.0     2       1       
2       2       2.0     0       1       0       0       0.0
+       M       M       0       1       0       0       0.0     6       1       
6       6       6.0     1       1       1       1       1.0
+       M       M       0       1       0       0       0.0     6       1       
6       6       6.0     2       1       2       2       2.0
+       M       M       1       1       1       1       1.0     1       1       
1       1       1.0     6       1       6       6       6.0
+
diff --git a/regression-test/data/tpcds_sf1_p1/sql/q45.out 
b/regression-test/data/tpcds_sf1_p1/sql/q45.out
new file mode 100644
index 0000000000..4ea716b0b3
--- /dev/null
+++ b/regression-test/data/tpcds_sf1_p1/sql/q45.out
@@ -0,0 +1,22 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !q45 --
+10150  Bunker Hill     20.250000000
+16098  Five Points     18.050000000
+28048  Salem   9.810000000
+29584  Oakdale 41.210000000
+31289  Lincoln 1.260000000
+34975  Kingston        56.670000000
+36971  Wilson  202.630000000
+38354  Sulphur Springs 25.680000000
+44975  Kingston        12.620000000
+62808  Hamilton        85.390000000
+62812  Shady Grove     48.770000000
+66557  Arlington       2.680000000
+68252  Maple Grove     11.370000000
+69583  Jackson 54.420000000
+73003  Hillcrest       36.030000000
+78222  Clinton 85.870000000
+83683  Plainview       43.820000000
+84536  Friendship      64.440000000
+88370  Oak Grove       52.420000000
+
diff --git 
a/regression-test/suites/correctness/test_subquery_in_disjunction.groovy 
b/regression-test/suites/correctness/test_subquery_in_disjunction.groovy
index 70b280addd..42c5cc5ed8 100644
--- a/regression-test/suites/correctness/test_subquery_in_disjunction.groovy
+++ b/regression-test/suites/correctness/test_subquery_in_disjunction.groovy
@@ -80,4 +80,44 @@ suite("test_subquery_in_disjunction") {
     order_qt_not_in_covered """
         SELECT * FROM test_sq_dj1 WHERE c1 NOT IN (SELECT c1 FROM test_sq_dj2) 
OR c1 = 100;
     """
+
+    qt_hash_join_with_other_conjuncts1 """
+        SELECT * FROM test_sq_dj1 WHERE c1 IN (SELECT c1 FROM test_sq_dj2 
WHERE test_sq_dj1.c1 > test_sq_dj2.c2) OR c1 < 10 ORDER BY c1;
+    """
+
+    qt_hash_join_with_other_conjuncts2 """
+        SELECT * FROM test_sq_dj1 WHERE c1 IN (SELECT c1 FROM test_sq_dj2 
WHERE test_sq_dj1.c1 < test_sq_dj2.c2) OR c1 < 10 ORDER BY c1;
+    """
+
+    qt_hash_join_with_other_conjuncts3 """
+        SELECT * FROM test_sq_dj1 WHERE c1 IN (SELECT c1 FROM test_sq_dj2 
WHERE test_sq_dj1.c1 > test_sq_dj2.c2) OR c1 < 11 ORDER BY c1;
+    """
+
+    qt_hash_join_with_other_conjuncts4 """
+        SELECT * FROM test_sq_dj1 WHERE c1 IN (SELECT c1 FROM test_sq_dj2 
WHERE test_sq_dj1.c1 < test_sq_dj2.c2) OR c1 < 11 ORDER BY c1;
+    """
+
+    qt_hash_join_with_other_conjuncts5 """
+        SELECT * FROM test_sq_dj1 WHERE c1 NOT IN (SELECT c1 FROM test_sq_dj2 
WHERE test_sq_dj1.c1 > test_sq_dj2.c2) OR c1 < 10 ORDER BY c1;
+    """
+
+    qt_hash_join_with_other_conjuncts6 """
+        SELECT * FROM test_sq_dj1 WHERE c1 NOT IN (SELECT c1 FROM test_sq_dj2 
WHERE test_sq_dj1.c1 < test_sq_dj2.c2) OR c1 < 10 ORDER BY c1;
+    """
+
+    qt_hash_join_with_other_conjuncts7 """
+        SELECT * FROM test_sq_dj1 WHERE c1 NOT IN (SELECT c1 FROM test_sq_dj2 
WHERE test_sq_dj1.c1 > test_sq_dj2.c2) OR c1 < 11 ORDER BY c1;
+    """
+
+    qt_hash_join_with_other_conjuncts8 """
+        SELECT * FROM test_sq_dj1 WHERE c1 NOT IN (SELECT c1 FROM test_sq_dj2 
WHERE test_sq_dj1.c1 < test_sq_dj2.c2) OR c1 < 11 ORDER BY c1;
+    """
+
+    qt_same_subquery_in_conjuncts """
+        SELECT * FROM test_sq_dj1 WHERE c1 IN (SELECT c1 FROM test_sq_dj2) OR 
c1 IN (SELECT c1 FROM test_sq_dj2) OR c1 < 10 ORDER BY c1;
+    """
+
+    qt_two_subquery_in_one_conjuncts """
+        SELECT * FROM test_sq_dj1 WHERE c1 IN (SELECT c1 FROM test_sq_dj2) OR 
c1 IN (SELECT c2 FROM test_sq_dj2) OR c1 < 10 ORDER BY c1;
+    """
 }
diff --git 
a/regression-test/suites/correctness_p0/test_left_anti_join_batch_size.sql 
b/regression-test/suites/correctness_p0/test_left_anti_join_batch_size.sql
new file mode 100644
index 0000000000..94d719fbaa
--- /dev/null
+++ b/regression-test/suites/correctness_p0/test_left_anti_join_batch_size.sql
@@ -0,0 +1,21 @@
+-- tables: supplier,lineitem,orders,nation
+SELECT /*+SEV_VAR(batch_size=3)*/
+  l1.l_orderkey okey,
+  l1.l_suppkey  skey
+FROM
+  regression_test_tpch_unique_sql_zstd_p0.lineitem l1
+WHERE
+  l1.l_receiptdate > l1.l_commitdate
+  AND l1.L_ORDERKEY < 10000
+  AND NOT exists(
+    SELECT *
+    FROM
+      regression_test_tpch_unique_sql_zstd_p0.lineitem l3
+    WHERE
+      l3.l_orderkey = l1.l_orderkey
+      AND l3.l_suppkey <> l1.l_suppkey
+      AND l3.l_receiptdate > l3.l_commitdate
+      AND l3.L_ORDERKEY < 10000
+  )
+ORDER BY
+  okey, skey
diff --git a/regression-test/suites/datatype_p0/date/test_date_exprs.groovy 
b/regression-test/suites/datatype_p0/date/test_date_exprs.groovy
index b77bb85bf5..6fb62b86d1 100644
--- a/regression-test/suites/datatype_p0/date/test_date_exprs.groovy
+++ b/regression-test/suites/datatype_p0/date/test_date_exprs.groovy
@@ -27,7 +27,7 @@ suite("test_date_exprs") {
     qt_sql1 """ select dt
              from
              (
-             select cast(k1 as datev2) as dt
+             select cast(k1 as date) as dt
              from ${tbName}
              ) r; """
     qt_sql2 """ select dt
diff --git a/regression-test/suites/tpcds_sf1_p1/sql/q10.sql 
b/regression-test/suites/tpcds_sf1_p1/sql/q10.sql
index f858219be1..c80ab6c0cd 100644
--- a/regression-test/suites/tpcds_sf1_p1/sql/q10.sql
+++ b/regression-test/suites/tpcds_sf1_p1/sql/q10.sql
@@ -1,4 +1,3 @@
-/*
 SELECT
   cd_gender
 , cd_marital_status
@@ -54,4 +53,3 @@ WHERE (c.c_current_addr_sk = ca.ca_address_sk)
 GROUP BY cd_gender, cd_marital_status, cd_education_status, 
cd_purchase_estimate, cd_credit_rating, cd_dep_count, cd_dep_employed_count, 
cd_dep_college_count
 ORDER BY cd_gender ASC, cd_marital_status ASC, cd_education_status ASC, 
cd_purchase_estimate ASC, cd_credit_rating ASC, cd_dep_count ASC, 
cd_dep_employed_count ASC, cd_dep_college_count ASC
 LIMIT 100
-*/
diff --git a/regression-test/suites/tpcds_sf1_p1/sql/q35.sql 
b/regression-test/suites/tpcds_sf1_p1/sql/q35.sql
index 1466c41c22..ed0d5c0f14 100644
--- a/regression-test/suites/tpcds_sf1_p1/sql/q35.sql
+++ b/regression-test/suites/tpcds_sf1_p1/sql/q35.sql
@@ -1,4 +1,3 @@
-/*
 SELECT
   ca_state
 , cd_gender
@@ -57,4 +56,3 @@ WHERE (c.c_current_addr_sk = ca.ca_address_sk)
 GROUP BY ca_state, cd_gender, cd_marital_status, cd_dep_count, 
cd_dep_employed_count, cd_dep_college_count
 ORDER BY ca_state ASC, cd_gender ASC, cd_marital_status ASC, cd_dep_count ASC, 
cd_dep_employed_count ASC, cd_dep_college_count ASC
 LIMIT 100
-*/
diff --git a/regression-test/suites/tpcds_sf1_p1/sql/q45.sql 
b/regression-test/suites/tpcds_sf1_p1/sql/q45.sql
index fe5bf82ef8..442f609879 100644
--- a/regression-test/suites/tpcds_sf1_p1/sql/q45.sql
+++ b/regression-test/suites/tpcds_sf1_p1/sql/q45.sql
@@ -1,4 +1,3 @@
-/*
 SELECT
   ca_zip
 , ca_city
@@ -25,4 +24,3 @@ WHERE (ws_bill_customer_sk = c_customer_sk)
 GROUP BY ca_zip, ca_city
 ORDER BY ca_zip ASC, ca_city ASC
 LIMIT 100
-*/


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

Reply via email to