airborne12 commented on code in PR #68661:
URL: https://github.com/apache/doris/pull/68661#discussion_r4201464447


##########
be/src/exprs/function/match.cpp:
##########
@@ -334,39 +507,44 @@ Status FunctionMatchAll::execute_match(FunctionContext* 
context, const std::stri
         return Status::OK();
     }
 
-    auto current_src_array_offset = 0;
     for (int i = 0; i < input_rows_count; i++) {
-        auto data_tokens = analyse_data_token(column_name, analyzer_ctx, 
string_col, i,
-                                              array_offsets, 
current_src_array_offset);
-
-        // TODO: more efficient impl
-        auto find_count = 0;
-        for (auto& term_info : query_tokens) {
-            auto it = std::find_if(data_tokens.begin(), data_tokens.end(),
-                                   [&](const segment_v2::TermInfo& info) {
-                                       return info.get_single_term() == 
term_info.get_single_term();
-                                   });
-            if (it != data_tokens.end()) {
-                ++find_count;
-            } else {
-                break;
-            }
-        }
-
-        if (find_count == query_tokens.size()) {
+        std::vector<uint8_t> found(query_tokens.size(), 0);
+        size_t remaining = query_tokens.size();

Review Comment:
   Commit `46a454423312` allocates MATCH_ALL row-tracking state only after a 
nonempty token set appears, then reuses it with row IDs instead of allocating 
and zeroing a bitmap for every row. Empty arrays therefore incur no per-row 
bitmap work. The MATCH suite passes 35/35 and the BE build passes.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to