@@ -774,6 +774,7 @@ Status SegmentIterator::_apply_index_except_leafnode_of_andnode() {
774
774
if (_downgrade_without_index (res, need_remaining_after_evaluate)) {
775
775
// downgrade without index query
776
776
_not_apply_index_pred.insert (pred->column_id ());
777
+ _need_read_data_indices[pred->column_id ()] = true ;
777
778
continue ;
778
779
}
779
780
LOG (WARNING) << " failed to evaluate index"
@@ -793,7 +794,10 @@ Status SegmentIterator::_apply_index_except_leafnode_of_andnode() {
793
794
_check_column_pred_all_push_down (column_name, true ,
794
795
pred->type () == PredicateType::MATCH) &&
795
796
!pred->predicate_params ()->marked_by_runtime_filter ) {
796
- _need_read_data_indices[pred->column_id ()] = false ;
797
+ // if column's need_read_data already set true, we can not set it to false now.
798
+ if (_need_read_data_indices.find (pred->column_id ()) == _need_read_data_indices.end ()) {
799
+ _need_read_data_indices[pred->column_id ()] = false ;
800
+ }
797
801
}
798
802
}
799
803
@@ -879,6 +883,7 @@ Status SegmentIterator::_apply_inverted_index_on_column_predicate(
879
883
if (!res.ok ()) {
880
884
if (_downgrade_without_index (res, need_remaining_after_evaluate)) {
881
885
remaining_predicates.emplace_back (pred);
886
+ _need_read_data_indices[pred->column_id ()] = true ;
882
887
return Status::OK ();
883
888
}
884
889
LOG (WARNING) << " failed to evaluate index"
@@ -909,7 +914,10 @@ Status SegmentIterator::_apply_inverted_index_on_column_predicate(
909
914
if (_check_column_pred_all_push_down (column_name, false ,
910
915
pred->type () == PredicateType::MATCH) &&
911
916
!pred->predicate_params ()->marked_by_runtime_filter ) {
912
- _need_read_data_indices[pred->column_id ()] = false ;
917
+ // if column's need_read_data already set true, we can not set it to false now.
918
+ if (_need_read_data_indices.find (pred->column_id ()) == _need_read_data_indices.end ()) {
919
+ _need_read_data_indices[pred->column_id ()] = false ;
920
+ }
913
921
}
914
922
}
915
923
return Status::OK ();
@@ -941,7 +949,9 @@ Status SegmentIterator::_apply_inverted_index_on_block_column_predicate(
941
949
if (res.ok ()) {
942
950
if (_check_column_pred_all_push_down (column_name) &&
943
951
!all_predicates_are_marked_by_runtime_filter (predicate_set)) {
944
- _need_read_data_indices[column_id] = false ;
952
+ if (_need_read_data_indices.find (column_id) == _need_read_data_indices.end ()) {
953
+ _need_read_data_indices[column_id] = false ;
954
+ }
945
955
}
946
956
no_need_to_pass_column_predicate_set.insert (predicate_set.begin (), predicate_set.end ());
947
957
_row_bitmap &= output_result;
0 commit comments