[Fix](inverted index) fix wrong no need read data when same column in inverted index and like function #36687 (#38581)
cherry pick from #36687
This commit is contained in:
@ -365,12 +365,18 @@ Status SegmentIterator::_init_impl(const StorageReadOptions& opts) {
|
||||
std::set<std::string> push_down_preds;
|
||||
for (auto* pred : _col_predicates) {
|
||||
if (!_check_apply_by_inverted_index(pred)) {
|
||||
//column predicate, like column predicate etc. always need read data
|
||||
auto cid = pred->column_id();
|
||||
_need_read_data_indices[cid] = true;
|
||||
continue;
|
||||
}
|
||||
push_down_preds.insert(_gen_predicate_result_sign(pred));
|
||||
}
|
||||
for (auto* pred : _col_preds_except_leafnode_of_andnode) {
|
||||
if (!_check_apply_by_inverted_index(pred)) {
|
||||
//column predicate, like column predicate etc. always need read data
|
||||
auto cid = pred->column_id();
|
||||
_need_read_data_indices[cid] = true;
|
||||
continue;
|
||||
}
|
||||
push_down_preds.insert(_gen_predicate_result_sign(pred));
|
||||
|
||||
@ -19,3 +19,9 @@
|
||||
-- !sql2 --
|
||||
2024-06-17T15:16:49 tengxun2
|
||||
|
||||
-- !sql3 --
|
||||
1
|
||||
|
||||
-- !sql4 --
|
||||
2024-06-17T15:16:49 tengxun2
|
||||
|
||||
|
||||
@ -110,4 +110,6 @@ suite("test_need_read_data", "p0"){
|
||||
|
||||
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' ; """
|
||||
qt_sql3 """ select COUNT(1) from ${indexTbName2} WHERE a >= '2024-06-15 00:00:00' AND b like '%tengxun%' and `b` match 'tengxun2' ; """
|
||||
qt_sql4 """ select * from ${indexTbName2} WHERE a >= '2024-06-15 00:00:00' AND b like '%tengxun%' and `b` match 'tengxun2' ; """
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user