From d6c5f551ecd483d4997251073723f488aeca2a24 Mon Sep 17 00:00:00 2001 From: mon Date: Mon, 24 Jun 2024 17:23:50 +0800 Subject: [PATCH] [Bug](exec) fix setSinkOp null flag bug --- be/src/pipeline/exec/set_sink_operator.cpp | 4 +++- be/src/pipeline/exec/set_sink_operator.h | 4 +++- regression-test/data/correctness_p0/test_set_operation.out | 4 ++++ .../suites/correctness_p0/test_set_operation.groovy | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/be/src/pipeline/exec/set_sink_operator.cpp b/be/src/pipeline/exec/set_sink_operator.cpp index 5fc38f3ca706acf..90071f8627b4b1e 100644 --- a/be/src/pipeline/exec/set_sink_operator.cpp +++ b/be/src/pipeline/exec/set_sink_operator.cpp @@ -171,6 +171,8 @@ Status SetSinkLocalState::open(RuntimeState* state) { SCOPED_TIMER(_open_timer); RETURN_IF_ERROR(PipelineXSinkLocalState::open(state)); + auto output_data_types = vectorized::VectorizedUtils::get_data_types( + _parent->cast>()._row_descriptor); auto& parent = _parent->cast(); DCHECK(parent._cur_child_id == 0); auto& child_exprs_lists = _shared_state->child_exprs_lists; @@ -180,7 +182,7 @@ Status SetSinkLocalState::open(RuntimeState* state) { for (const auto& ctl : child_exprs_lists) { for (int i = 0; i < ctl.size(); ++i) { _shared_state->build_not_ignore_null[i] = - _shared_state->build_not_ignore_null[i] || ctl[i]->root()->is_nullable(); + output_data_types[i] || ctl[i]->root()->is_nullable(); } } _shared_state->hash_table_init(); diff --git a/be/src/pipeline/exec/set_sink_operator.h b/be/src/pipeline/exec/set_sink_operator.h index 09a1fa09e7ccbfc..46c75b97150b5d4 100644 --- a/be/src/pipeline/exec/set_sink_operator.h +++ b/be/src/pipeline/exec/set_sink_operator.h @@ -77,7 +77,8 @@ class SetSinkOperatorX final : public DataSinkOperatorX _partition_exprs; using OperatorBase::_child_x; + const RowDescriptor _row_descriptor; }; } // namespace pipeline diff --git a/regression-test/data/correctness_p0/test_set_operation.out b/regression-test/data/correctness_p0/test_set_operation.out index 09fa8314065ac04..0e19fba622d9ab8 100644 --- a/regression-test/data/correctness_p0/test_set_operation.out +++ b/regression-test/data/correctness_p0/test_set_operation.out @@ -11,3 +11,7 @@ aaaa bbbb -- !select1 -- + +-- !select1 -- +3.0 + diff --git a/regression-test/suites/correctness_p0/test_set_operation.groovy b/regression-test/suites/correctness_p0/test_set_operation.groovy index 5ee6348a0376857..eadcb3cf8ad32ed 100644 --- a/regression-test/suites/correctness_p0/test_set_operation.groovy +++ b/regression-test/suites/correctness_p0/test_set_operation.groovy @@ -127,4 +127,6 @@ suite("test_set_operation") { qt_select1 """ (select 0) intersect (select null); """ + qt_select1 """ select sqrt('9') except select sqrt('4'); """ + }