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](inverted index) fix wrong no need read data when need_remaining_after_evaluate #36637

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
[Fix](inverted index) fix wrong no need read data when need_remaining…
…_after_evaluate
  • Loading branch information
airborne12 committed Jun 21, 2024
commit d352d7ef022adcbbb9e8f3bac0679870817d8d84
1 change: 1 addition & 0 deletions be/src/olap/rowset/segment_v2/segment_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,7 @@ Status SegmentIterator::_apply_inverted_index_on_column_predicate(

if (need_remaining_after_evaluate) {
remaining_predicates.emplace_back(pred);
_need_read_data_indices[pred->column_id()] = true;
return Status::OK();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@
4 8
1 9

-- !sql1 --
0

-- !sql2 --
2024-06-17T15:16:49 tengxun2

Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,35 @@ suite("test_need_read_data", "p0"){
} finally {
//try_sql("DROP TABLE IF EXISTS ${testTable}")
}
}

def indexTbName2 = "test_need_read_data_2"

sql "DROP TABLE IF EXISTS ${indexTbName2}"

sql """
create table ${indexTbName2} (
a datetime not null,
b varchar not null,
INDEX idx_inverted_b (`b`) USING INVERTED PROPERTIES("parser" = "unicode", "support_phrase" = "true") COMMENT ''
) ENGINE=OLAP
DUPLICATE KEY(`a`)
COMMENT ''
DISTRIBUTED BY HASH(`a`) BUCKETS 1
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
);
"""
sql """insert into ${indexTbName2} values
('2024-06-03 15:16:49.266678','shanghai'),
('2024-06-02 15:16:49.266678','shenzhen'),
('2024-06-01 15:16:49.266678','beijing'),
('2024-06-13 15:16:49.266678','beijing'),
('2024-06-14 15:16:49.266678','beijing'),
('2024-06-15 15:16:49.266678','shanghai'),
('2024-06-16 15:16:49.266678','tengxun'),
('2024-06-17 15:16:49.266678','tengxun2')
"""

qt_sql1 """ select COUNT(1) from ${indexTbName2} WHERE a >= '2024-06-15 00:00:00' AND b = 'tengxun2' and `b` match 'tengxun2' ; """
qt_sql2 """ select * from ${indexTbName2} WHERE a >= '2024-06-15 00:00:00' AND b = 'tengxun2' and `b` match 'tengxun2' ; """
}
Loading