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 44c7c78fccfec4e2dc6765f5ec11a490ac42615d
Author: Jerry Hu <mrh...@gmail.com>
AuthorDate: Mon Sep 11 11:54:44 2023 +0800

    [fix](join) avoid DCHECK failed in '_filter_data_and_build_output' (#24162)
    
    avoid DCHECK failed in '_filter_data_and_build_output'
---
 be/src/vec/exec/join/vhash_join_node.cpp | 12 +++++++++---
 be/src/vec/exec/join/vhash_join_node.h   |  3 ++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/be/src/vec/exec/join/vhash_join_node.cpp 
b/be/src/vec/exec/join/vhash_join_node.cpp
index 284a193779..b59027fc14 100644
--- a/be/src/vec/exec/join/vhash_join_node.cpp
+++ b/be/src/vec/exec/join/vhash_join_node.cpp
@@ -571,7 +571,11 @@ Status HashJoinNode::pull(doris::RuntimeState* state, 
vectorized::Block* output_
                     ->get_data()
                     .resize_fill(block_rows, 1);
         }
-        RETURN_IF_ERROR(_filter_data_and_build_output(state, output_block, 
eos, &temp_block));
+
+        /// No need to check the block size in `_filter_data_and_build_output` 
because here dose not
+        /// increase the output rows count(just same as `_probe_block`'s rows 
count).
+        RETURN_IF_ERROR(
+                _filter_data_and_build_output(state, output_block, eos, 
&temp_block, false));
         temp_block.clear();
         release_block_memory(_probe_block);
         return Status::OK();
@@ -659,12 +663,14 @@ Status HashJoinNode::pull(doris::RuntimeState* state, 
vectorized::Block* output_
 
 Status HashJoinNode::_filter_data_and_build_output(RuntimeState* state,
                                                    vectorized::Block* 
output_block, bool* eos,
-                                                   Block* temp_block) {
+                                                   Block* temp_block, bool 
check_rows_count) {
     if (_is_outer_join) {
         _add_tuple_is_null_column(temp_block);
     }
     auto output_rows = temp_block->rows();
-    DCHECK(output_rows <= state->batch_size());
+    if (check_rows_count) { // If the join node does not increase the number 
of output rows, no need to check.
+        DCHECK(output_rows <= state->batch_size());
+    }
     {
         SCOPED_TIMER(_join_filter_timer);
         RETURN_IF_ERROR(VExprContext::filter_block(_conjuncts, temp_block, 
temp_block->columns()));
diff --git a/be/src/vec/exec/join/vhash_join_node.h 
b/be/src/vec/exec/join/vhash_join_node.h
index 639b570934..b94d721402 100644
--- a/be/src/vec/exec/join/vhash_join_node.h
+++ b/be/src/vec/exec/join/vhash_join_node.h
@@ -404,7 +404,8 @@ private:
     void _add_tuple_is_null_column(Block* block) override;
 
     Status _filter_data_and_build_output(RuntimeState* state, 
vectorized::Block* output_block,
-                                         bool* eos, Block* temp_block);
+                                         bool* eos, Block* temp_block,
+                                         bool check_rows_count = true);
 
     template <class HashTableContext>
     friend struct ProcessHashTableBuild;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to