Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](intersect) fix intersect query failed in row storage code #12712

Merged
merged 1 commit into from
Sep 19, 2022
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
8 changes: 0 additions & 8 deletions be/src/exec/set_operation_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ Status SetOperationNode::prepare(RuntimeState* state) {
}
_build_tuple_size = child(0)->row_desc().tuple_descriptors().size();
_build_tuple_row_size = _build_tuple_size * sizeof(Tuple*);
_build_tuple_idx.reserve(_build_tuple_size);

for (int i = 0; i < _build_tuple_size; ++i) {
TupleDescriptor* build_tuple_desc = child(0)->row_desc().tuple_descriptors()[i];
auto tuple_idx = _row_descriptor.get_tuple_idx(build_tuple_desc->id());
RETURN_IF_INVALID_TUPLE_IDX(build_tuple_desc->id(), tuple_idx);
_build_tuple_idx.push_back(tuple_idx);
}
_find_nulls = std::vector<bool>();
for (auto ctx : _child_expr_lists[0]) {
_find_nulls.push_back(!ctx->root()->is_slotref() || ctx->is_nullable());
Expand Down
1 change: 0 additions & 1 deletion be/src/exec/set_operation_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class SetOperationNode : public ExecNode {
// holds everything referenced in _hash_tbl
std::unique_ptr<MemPool> _build_pool;

std::vector<int> _build_tuple_idx;
int _build_tuple_size;
int _build_tuple_row_size;
std::vector<bool> _find_nulls;
Expand Down
5 changes: 5 additions & 0 deletions regression-test/data/query_p0/intersect/test_intersect.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
2
3

-- !select --
1
2
3

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
// under the License.

suite("test_intersect") {
sql 'set enable_vectorized_engine=false'
qt_select """
SELECT * FROM (SELECT k1 FROM test_query_db.baseall
INTERSECT SELECT k1 FROM test_query_db.test) a ORDER BY k1
"""

sql 'set enable_vectorized_engine=true'
qt_select """
SELECT * FROM (SELECT k1 FROM test_query_db.baseall
INTERSECT SELECT k1 FROM test_query_db.test) a ORDER BY k1
Expand Down