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 d431a35721 [Fix](inverted index) fix non-index match function core 
(#22959)
d431a35721 is described below

commit d431a357216b2d8c1ee1a8f28611d8f72081a79c
Author: airborne12 <airborn...@gmail.com>
AuthorDate: Tue Aug 15 11:27:12 2023 +0800

    [Fix](inverted index) fix non-index match function core (#22959)
---
 be/src/vec/exprs/vmatch_predicate.cpp | 2 +-
 be/src/vec/functions/match.cpp        | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/be/src/vec/exprs/vmatch_predicate.cpp 
b/be/src/vec/exprs/vmatch_predicate.cpp
index a06d248979..3eee50c974 100644
--- a/be/src/vec/exprs/vmatch_predicate.cpp
+++ b/be/src/vec/exprs/vmatch_predicate.cpp
@@ -87,7 +87,7 @@ Status VMatchPredicate::open(RuntimeState* state, 
VExprContext* context,
                              FunctionContext::FunctionStateScope scope) {
     RETURN_IF_ERROR(VExpr::open(state, context, scope));
     RETURN_IF_ERROR(VExpr::init_function_context(context, scope, _function));
-    if (scope == FunctionContext::THREAD_LOCAL) {
+    if (scope == FunctionContext::THREAD_LOCAL || scope == 
FunctionContext::FRAGMENT_LOCAL) {
         context->fn_context(_fn_context_index)->set_function_state(scope, 
_inverted_index_ctx);
     }
     return Status::OK();
diff --git a/be/src/vec/functions/match.cpp b/be/src/vec/functions/match.cpp
index 3c47699369..bba640fa9f 100644
--- a/be/src/vec/functions/match.cpp
+++ b/be/src/vec/functions/match.cpp
@@ -34,6 +34,10 @@ Status FunctionMatchBase::execute_impl(FunctionContext* 
context, Block& block,
                    << ", match_query_str=" << match_query_str;
         InvertedIndexCtx* inverted_index_ctx = 
reinterpret_cast<InvertedIndexCtx*>(
                 context->get_function_state(FunctionContext::THREAD_LOCAL));
+        if (inverted_index_ctx == nullptr) {
+            inverted_index_ctx = reinterpret_cast<InvertedIndexCtx*>(
+                    
context->get_function_state(FunctionContext::FRAGMENT_LOCAL));
+        }
 
         const ColumnPtr source_col =
                 
block.get_by_position(arguments[0]).column->convert_to_full_column_if_const();


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

Reply via email to