Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions be/src/pipeline/dependency.h
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,9 @@ struct SetSharedState : public BasicSharedState {
// (select 0) intersect (select null) the build side hash table should not
// ignore null value.
std::vector<DataTypePtr> data_types;
for (const auto& ctx : child_exprs_lists[0]) {
data_types.emplace_back(build_not_ignore_null[0]
for (int i = 0; i < child_exprs_lists[0].size(); i++) {
const auto& ctx = child_exprs_lists[0][i];
data_types.emplace_back(build_not_ignore_null[i]
? make_nullable(ctx->root()->data_type())
: ctx->root()->data_type());
}
Expand Down
8 changes: 6 additions & 2 deletions be/src/pipeline/exec/set_sink_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,13 @@ Status SetSinkOperatorX<is_intersect>::_extract_build_column(
block.get_by_position(result_col_id).column =
block.get_by_position(result_col_id).column->convert_to_full_column_if_const();
}
// Do make nullable should not change the origin column and type in origin block
// which may cause coredump problem
if (local_state._shared_state->build_not_ignore_null[i]) {
block.get_by_position(result_col_id).column =
make_nullable(block.get_by_position(result_col_id).column);
auto column_ptr = make_nullable(block.get_by_position(result_col_id).column, false);
block.insert(
{column_ptr, make_nullable(block.get_by_position(result_col_id).type), ""});
result_col_id = block.columns() - 1;
}

raw_ptrs[i] = block.get_by_position(result_col_id).column.get();
Expand Down
2 changes: 2 additions & 0 deletions regression-test/data/query_p0/except/test_query_except.out
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
14
15

-- !select_except2 --

Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ suite("test_query_except", "arrow_flight_sql") {
SELECT * FROM (SELECT k1 FROM test_query_db.baseall
EXCEPT SELECT k1 FROM test_query_db.test) a ORDER BY k1
"""
qt_select_except2 """
select not_null_k1, not_null_k1 from (SELECT non_nullable(k1) as not_null_k1 FROM test_query_db.baseall where k1 is not null) b1 except select non_nullable(k1), k1 from test_query_db.baseall where k1 is not null order by 1, 2;
"""
}
Loading