HappenLee commented on code in PR #39354: URL: https://github.com/apache/doris/pull/39354#discussion_r1737705030
########## be/src/vec/functions/functions_multi_string_search.cpp: ########## @@ -287,46 +311,30 @@ struct FunctionMultiMatchAnyImpl { continue; } - multiregexps::DeferredConstructedRegexpsPtr deferred_constructed_regexps = - multiregexps::getOrSet</*SaveIndices*/ FindAnyIndex, WithEditDistance>( - needles, std::nullopt); - multiregexps::Regexps* regexps = deferred_constructed_regexps->get(); - - hs_scratch_t* scratch = nullptr; - hs_error_t err = hs_clone_scratch(regexps->getScratch(), &scratch); - - if (err != HS_SUCCESS) - return Status::InternalError("could not clone scratch space for vectorscan"); - - multiregexps::ScratchPtr smart_scratch(scratch); - - auto on_match = []([[maybe_unused]] unsigned int id, - unsigned long long /* from */, // NOLINT - unsigned long long /* to */, // NOLINT - unsigned int /* flags */, void* context) -> int { - if constexpr (FindAnyIndex) - *reinterpret_cast<ResultType*>(context) = id; - else if constexpr (FindAny) - *reinterpret_cast<ResultType*>(context) = 1; - /// Once we hit the callback, there is no need to search for others. - return 1; - }; + multiregexps::Regexps* regexps = nullptr; + multiregexps::ScratchPtr smart_scratch; + Status status = prepare_regexps_and_scratch(needles, regexps, smart_scratch); Review Comment: same to the upper comment -- 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