Skip to content

Commit

Permalink
[fix](intersect) fix intersect query failed in row storage code (apac…
Browse files Browse the repository at this point in the history
  • Loading branch information
luozenglin authored and Yijia Su committed Oct 8, 2022
1 parent c9992ba commit 210d042
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
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

0 comments on commit 210d042

Please sign in to comment.