Skip to content

Commit

Permalink
[fix](union) union source operator hold too many blocks from children (
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhhsg authored Mar 25, 2024
1 parent 1f06ef7 commit e98b4b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions be/src/pipeline/exec/union_source_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ Status UnionSourceOperatorX::get_block(RuntimeState* state, vectorized::Block* b
Defer set_eos {[&]() {
//have executing const expr, queue have no data anymore, and child could be closed
*eos = (_child_size == 0 && !local_state._need_read_for_const_expr) ||
(_child_size > 0 && local_state._shared_state->data_queue.is_all_finish() &&
!_has_data(state));
// here should check `_has_data` first, or when `is_all_finish` is false,
// the data queue will have no chance to change the `_flag_queue_idx`.
(!_has_data(state) && _child_size > 0 &&
local_state._shared_state->data_queue.is_all_finish());
}};

SCOPED_TIMER(local_state.exec_time_counter());
Expand Down

0 comments on commit e98b4b3

Please sign in to comment.