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
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 7635fd5e04a [fix](pipeline) incorrect result caused by missing output
block of union operator(#29677) (#29811)
7635fd5e04a is described below
commit 7635fd5e04a4fdd54bc84e6eaeb7e24374feaf6d
Author: Jerry Hu <[email protected]>
AuthorDate: Wed Jan 10 22:26:23 2024 +0800
[fix](pipeline) incorrect result caused by missing output block of union
operator(#29677) (#29811)
---
be/src/pipeline/exec/union_source_operator.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/be/src/pipeline/exec/union_source_operator.cpp
b/be/src/pipeline/exec/union_source_operator.cpp
index ffd8b86384f..1b4f4125619 100644
--- a/be/src/pipeline/exec/union_source_operator.cpp
+++ b/be/src/pipeline/exec/union_source_operator.cpp
@@ -86,11 +86,15 @@ Status UnionSourceOperator::get_block(RuntimeState* state,
vectorized::Block* bl
state, block, &eos,
std::bind(&UnionSourceOperator::pull_data, this,
std::placeholders::_1,
std::placeholders::_2, std::placeholders::_3)));
- //have exectue const expr, queue have no data any more, and child could be
colsed
- if (eos || (!_has_data() && _data_queue->is_all_finish())) {
+ //have executing const expr, queue have no data anymore, and child could
be closed.
+ if (eos) { // reach limit
source_state = SourceState::FINISHED;
} else if (_has_data()) {
source_state = SourceState::MORE_DATA;
+ } else if (_data_queue->is_all_finish()) {
+ // Here, check the value of `_has_data(state)` again after
`data_queue.is_all_finish()` is TRUE
+ // as there may be one or more blocks when
`data_queue.is_all_finish()` is TRUE.
+ source_state = _has_data() ? SourceState::MORE_DATA :
SourceState::FINISHED;
} else {
source_state = SourceState::DEPEND_ON_SOURCE;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]