Tanya-W commented on code in PR #16994:
URL: https://github.com/apache/doris/pull/16994#discussion_r1113831067


##########
be/src/olap/rowset/segment_v2/segment_iterator.cpp:
##########
@@ -550,21 +550,35 @@ bool 
SegmentIterator::_check_apply_by_bitmap_index(ColumnPredicate* pred) {
     return true;
 }
 
-bool SegmentIterator::_check_apply_by_inverted_index(ColumnPredicate* pred) {
+bool SegmentIterator::_check_apply_by_inverted_index(ColumnPredicate* pred, 
bool pred_in_compound) {
     int32_t unique_id = _schema.unique_id(pred->column_id());
-    bool handle_by_fulltext = _is_handle_predicate_by_fulltext(unique_id);
-
     if (_inverted_index_iterators.count(unique_id) < 1 ||
-        _inverted_index_iterators[unique_id] == nullptr ||
-        (pred->type() != PredicateType::MATCH && handle_by_fulltext) ||
-        pred->type() == PredicateType::IS_NULL || pred->type() == 
PredicateType::IS_NOT_NULL ||
-        pred->type() == PredicateType::BF) {
-        // 1. this column without inverted index
-        // 2. equal or range qeury for fulltext index
-        // 3. is_null or is_not_null predicate
-        // 4. bloom filter predicate
+        _inverted_index_iterators[unique_id] == nullptr) {
+        //this column without inverted index
+        return false;
+    }
+
+    if (_inverted_index_not_support_pred_type(pred->type())) {
         return false;
     }
+
+    if ((pred->type() == PredicateType::IN_LIST || pred->type() == 
PredicateType::NOT_IN_LIST) &&
+        pred->predicate_params()->marked_by_runtime_filter) {
+        // in_list or not_in_list predicate produced by runtime filter
+        return false;
+    }
+
+    bool handle_by_fulltext = _column_has_fulltext_index(unique_id);
+    if (handle_by_fulltext) {
+        // when predicate in compound condition which except leafNode of 
andNode,
+        // only can apply match query for fulltext index,
+        // when predicate is leafNode of andNode,
+        // can apply 'match qeury' and 'equal query' and 'list query' for 
fulltext index.
+        return (pred_in_compound ? pred->type() == PredicateType::MATCH
+                                 : (pred->type() == PredicateType::MATCH ||
+                                    
PredicateTypeTraits::is_eqaul_and_list(pred->type())));
+    }

Review Comment:
   it is right, before check `handle_by_fulltext ` already check other case, if 
`handle_by_fulltext == false ` return true means can apply by bkd index reader 
or string type index reader



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to