diff --git a/be/src/pipeline/exec/join_probe_operator.cpp b/be/src/pipeline/exec/join_probe_operator.cpp index 48607309eca42d..5c89075e8b9a98 100644 --- a/be/src/pipeline/exec/join_probe_operator.cpp +++ b/be/src/pipeline/exec/join_probe_operator.cpp @@ -86,7 +86,12 @@ Status JoinProbeLocalState::_build_output_block( // In previous versions, the join node had a separate set of project structures, // and you could see a 'todo' in the Thrift definition. // Here, we have refactored it, but considering upgrade compatibility, we still need to retain the old code. - *output_block = *origin_block; + if (!output_block->mem_reuse()) { + vectorized::MutableBlock tmp( + vectorized::VectorizedUtils::create_columns_with_type_and_name(p.row_desc())); + output_block->swap(tmp.to_block()); + } + output_block->swap(*origin_block); return Status::OK(); } SCOPED_TIMER(_build_output_block_timer); diff --git a/be/src/vec/exec/join/vjoin_node_base.cpp b/be/src/vec/exec/join/vjoin_node_base.cpp index 4697be19b84ee6..9b954811ee9a02 100644 --- a/be/src/vec/exec/join/vjoin_node_base.cpp +++ b/be/src/vec/exec/join/vjoin_node_base.cpp @@ -184,7 +184,11 @@ Status VJoinNodeBase::_build_output_block(Block* origin_block, Block* output_blo // In previous versions, the join node had a separate set of project structures, // and you could see a 'todo' in the Thrift definition. // Here, we have refactored it, but considering upgrade compatibility, we still need to retain the old code. - *output_block = *origin_block; + if (!output_block->mem_reuse()) { + MutableBlock tmp(VectorizedUtils::create_columns_with_type_and_name(row_desc())); + output_block->swap(tmp.to_block()); + } + output_block->swap(*origin_block); return Status::OK(); } auto is_mem_reuse = output_block->mem_reuse();