diff --git a/be/src/vec/exec/vexchange_node.cpp b/be/src/vec/exec/vexchange_node.cpp index f790aa74363eed..004999ed4b8291 100644 --- a/be/src/vec/exec/vexchange_node.cpp +++ b/be/src/vec/exec/vexchange_node.cpp @@ -100,10 +100,13 @@ Status VExchangeNode::get_next(RuntimeState* state, Block* block, bool* eos) { } Status VExchangeNode::close(RuntimeState* state) { + if (is_closed()) { + return Status::OK(); + } + if (_stream_recvr != nullptr) { _stream_recvr->close(); } - if (_is_merging) _vsort_exec_exprs.close(state); return ExecNode::close(state); diff --git a/be/src/vec/exec/vunion_node.cpp b/be/src/vec/exec/vunion_node.cpp index 4484a2973f31a1..15494c24f958b9 100644 --- a/be/src/vec/exec/vunion_node.cpp +++ b/be/src/vec/exec/vunion_node.cpp @@ -218,6 +218,7 @@ Status VUnionNode::get_next(RuntimeState* state, Block* block, bool* eos) { RETURN_IF_CANCELLED(state); // RETURN_IF_ERROR(QueryMaintenance(state)); + // TODO: Rethink the logic, which cause close the exec node twice. if (_to_close_child_idx != -1) { // The previous child needs to be closed if passthrough was enabled for it. In the non // passthrough case, the child was already closed in the previous call to get_next().