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

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


The following commit(s) were added to refs/heads/master by this push:
     new 74d88d5f76e [update](session-var) set 
ENABLE_COMMON_EXPR_PUSHDOWN_FOR_INVERTED_INDEX default to true (#35387)
74d88d5f76e is described below

commit 74d88d5f76eb8c04f3425788992ba1ff79a1211c
Author: amory <wangqian...@selectdb.com>
AuthorDate: Tue Jul 2 15:20:05 2024 +0800

    [update](session-var) set ENABLE_COMMON_EXPR_PUSHDOWN_FOR_INVERTED_INDEX 
default to true (#35387)
    
    set session variable ENABLE_COMMON_EXPR_PUSHDOWN_FOR_INVERTED_INDEX default 
value to true and limit it to array_contains function.
---
 be/src/olap/rowset/segment_v2/segment_iterator.cpp                | 7 +++++++
 fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java | 7 ++++---
 2 files changed, 11 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 a8a9758afcd..82a3c8ba509 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.cpp
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.cpp
@@ -90,6 +90,7 @@
 #include "vec/exprs/vexpr_context.h"
 #include "vec/exprs/vliteral.h"
 #include "vec/exprs/vslot_ref.h"
+#include "vec/functions/array/function_array_index.h"
 #include "vec/json/path_in_data.h"
 
 namespace doris {
@@ -1342,6 +1343,12 @@ Status SegmentIterator::_apply_inverted_index() {
             // _inverted_index_iterators has all column ids which has inverted 
index
             // _common_expr_columns has all column ids from 
_common_expr_ctxs_push_down
             // if current bitmap is already empty just return
+            if (!(expr_ctx->root()->node_type() == 
TExprNodeType::FUNCTION_CALL &&
+                  expr_ctx->root()->fn().name.function_name ==
+                          vectorized::ArrayContainsAction::name)) {
+                // now we only support ArrayContains function to evaluate 
inverted index
+                continue;
+            }
             if (_row_bitmap.isEmpty()) {
                 break;
             }
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 7aa78c2bbb2..59b5d89ac2b 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
@@ -1471,9 +1471,9 @@ public class SessionVariable implements Serializable, 
Writable {
     public boolean enableInvertedIndexQuery = true;
 
     // Whether enable query expr with inverted index.
-    @VariableMgr.VarAttr(name = 
ENABLE_COMMON_EXPR_PUSHDOWN_FOR_INVERTED_INDEX, needForward = true, description 
= {
-            "是否启用表达式上使用 inverted index。", "Set whether to use inverted index 
query for expr."})
-    public boolean enableCommonExpPushDownForInvertedIndex = false;
+    @VariableMgr.VarAttr(name = 
ENABLE_COMMON_EXPR_PUSHDOWN_FOR_INVERTED_INDEX, fuzzy = true, needForward = 
true,
+            description = {"是否启用表达式上使用 inverted index。", "Set whether to use 
inverted index query for expr."})
+    public boolean enableCommonExpPushDownForInvertedIndex = true;
 
     // Whether enable pushdown count agg to scan node when using inverted 
index match.
     @VariableMgr.VarAttr(name = ENABLE_PUSHDOWN_COUNT_ON_INDEX, needForward = 
true, description = {
@@ -2008,6 +2008,7 @@ public class SessionVariable implements Serializable, 
Writable {
         this.enableLocalExchange = random.nextBoolean();
         // This will cause be dead loop, disable it first
         // this.disableJoinReorder = random.nextBoolean();
+        this.enableCommonExpPushDownForInvertedIndex = random.nextBoolean();
         this.disableStreamPreaggregations = random.nextBoolean();
         this.partitionedHashJoinRowsThreshold = random.nextBoolean() ? 8 : 
1048576;
         this.partitionedHashAggRowsThreshold = random.nextBoolean() ? 8 : 
1048576;


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

Reply via email to