Skip to content

Commit

Permalink
[Bug](exec) fix setSinkOp null flag bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yoko123yoko committed Jun 24, 2024
1 parent d7dc33a commit 1e1508f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
5 changes: 4 additions & 1 deletion be/src/pipeline/exec/set_sink_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ Status SetSinkLocalState<is_intersect>::open(RuntimeState* state) {
SCOPED_TIMER(_open_timer);
RETURN_IF_ERROR(PipelineXSinkLocalState<SetSharedState>::open(state));

auto output_data_types = vectorized::VectorizedUtils::get_data_types(
_parent->cast<SetSinkOperatorX<is_intersect>>()._row_descriptor);
auto& parent = _parent->cast<Parent>();
DCHECK(parent._cur_child_id == 0);
auto& child_exprs_lists = _shared_state->child_exprs_lists;
Expand All @@ -180,7 +182,8 @@ Status SetSinkLocalState<is_intersect>::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] || _shared_state->build_not_ignore_null[i] ||
ctl[i]->root()->is_nullable());
}
}
_shared_state->hash_table_init();
Expand Down
4 changes: 3 additions & 1 deletion be/src/pipeline/exec/set_sink_operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ class SetSinkOperatorX final : public DataSinkOperatorX<SetSinkLocalState<is_int
_is_colocate(is_intersect ? tnode.intersect_node.is_colocate
: tnode.except_node.is_colocate),
_partition_exprs(is_intersect ? tnode.intersect_node.result_expr_lists[child_id]
: tnode.except_node.result_expr_lists[child_id]) {}
: tnode.except_node.result_expr_lists[child_id]),
_row_descriptor(descs, tnode.row_tuples, tnode.nullable_tuples) {}
~SetSinkOperatorX() override = default;
Status init(const TDataSink& tsink) override {
return Status::InternalError("{} should not init with TDataSink",
Expand Down Expand Up @@ -113,6 +114,7 @@ class SetSinkOperatorX final : public DataSinkOperatorX<SetSinkLocalState<is_int
const bool _is_colocate;
const std::vector<TExpr> _partition_exprs;
using OperatorBase::_child_x;
const RowDescriptor _row_descriptor;
};

} // namespace pipeline
Expand Down
4 changes: 4 additions & 0 deletions regression-test/data/correctness_p0/test_set_operation.out
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ aaaa
bbbb

-- !select1 --

-- !select1 --
3.0

Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,6 @@ suite("test_set_operation") {

qt_select1 """ (select 0) intersect (select null); """

qt_select1 """ select sqrt('9') except select sqrt('4'); """

}

0 comments on commit 1e1508f

Please sign in to comment.