This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 7d0521a1211 [fix](inverted index) Add session switch to compound 
inlist (#34388)
7d0521a1211 is described below

commit 7d0521a1211cbf9aa054f0c12660925107d45eb5
Author: zzzxl <[email protected]>
AuthorDate: Sat May 4 16:21:51 2024 +0800

    [fix](inverted index) Add session switch to compound inlist (#34388)
---
 be/src/olap/rowset/segment_v2/segment_iterator.cpp               | 8 +++++---
 .../src/main/java/org/apache/doris/qe/SessionVariable.java       | 9 +++++++++
 gensrc/thrift/PaloInternalService.thrift                         | 2 ++
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.cpp 
b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
index 52a37bada33..920c6eb17fb 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
@@ -830,9 +830,11 @@ Status 
SegmentIterator::_apply_index_except_leafnode_of_andnode() {
         bool is_support = pred_type == PredicateType::EQ || pred_type == 
PredicateType::NE ||
                           pred_type == PredicateType::LT || pred_type == 
PredicateType::LE ||
                           pred_type == PredicateType::GT || pred_type == 
PredicateType::GE ||
-                          pred_type == PredicateType::MATCH ||
-                          pred_type == PredicateType::IN_LIST ||
-                          pred_type == PredicateType::NOT_IN_LIST;
+                          pred_type == PredicateType::MATCH;
+        if 
(_opts.runtime_state->query_options().enable_inverted_index_compound_inlist) {
+            is_support |= (pred_type == PredicateType::IN_LIST ||
+                           pred_type == PredicateType::NOT_IN_LIST);
+        }
         if (!is_support) {
             continue;
         }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index 633389812e3..cfa7fc64e24 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -464,6 +464,8 @@ public class SessionVariable implements Serializable, 
Writable {
 
     public static final String LIMIT_ROWS_FOR_SINGLE_INSTANCE = 
"limit_rows_for_single_instance";
 
+    public static final String ENABLE_INVERTED_INDEX_COMPOUND_INLIST = 
"enable_inverted_index_compound_inlist";
+
     /**
      * If set false, user couldn't submit analyze SQL and FE won't allocate 
any related resources.
      */
@@ -1366,6 +1368,11 @@ public class SessionVariable implements Serializable, 
Writable {
                             + "to reduce the fan-out of simple queries"})
     public long limitRowsForSingleInstance = 10000;
 
+    @VariableMgr.VarAttr(name = ENABLE_INVERTED_INDEX_COMPOUND_INLIST,
+            description = {"让compound inlist条件可以使用倒排索引",
+                    "Let the compound inlist condition use an inverted index"})
+    public boolean enableInvertedIndexCompoundInlist = false;
+
     public Set<Integer> getIgnoredRuntimeFilterIds() {
         return Arrays.stream(ignoreRuntimeFilterIds.split(",[\\s]*"))
                 .map(v -> {
@@ -2575,6 +2582,8 @@ public class SessionVariable implements Serializable, 
Writable {
 
         tResult.setInvertedIndexSkipThreshold(invertedIndexSkipThreshold);
 
+        
tResult.setEnableInvertedIndexCompoundInlist(enableInvertedIndexCompoundInlist);
+
         return tResult;
     }
 
diff --git a/gensrc/thrift/PaloInternalService.thrift 
b/gensrc/thrift/PaloInternalService.thrift
index aa49adb1f62..22422aeabac 100644
--- a/gensrc/thrift/PaloInternalService.thrift
+++ b/gensrc/thrift/PaloInternalService.thrift
@@ -253,6 +253,8 @@ struct TQueryOptions {
   88: optional i32 inverted_index_max_expansions = 50;
 
   89: optional i32 inverted_index_skip_threshold = 50;
+
+  90: optional bool enable_inverted_index_compound_inlist = false;
 }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to