Skip to content

Commit

Permalink
[Fix](inverted index) fix non-index match function core (apache#22959)
Browse files Browse the repository at this point in the history
  • Loading branch information
airborne12 committed Aug 21, 2023
1 parent fd38add commit 6e411a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion be/src/vec/exprs/vmatch_predicate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions be/src/vec/functions/match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 6e411a2

Please sign in to comment.