airborne12 commented on code in PR #20344: URL: https://github.com/apache/doris/pull/20344#discussion_r1213882467
########## be/src/vec/functions/match.cpp: ########## @@ -119,13 +162,28 @@ Status FunctionMatchAll::execute_match(const std::string& column_name, << ", please check your query sql"; return Status::Error<ErrorCode::INVERTED_INDEX_NO_TERMS>(); } + + auto current_src_array_offset = 0; for (int i = 0; i < input_rows_count; i++) { - const auto& str_ref = datas->get_data_at(i); - std::vector<std::wstring> data_tokens = - doris::segment_v2::InvertedIndexReader::get_analyse_result( - column_name, str_ref.to_string(), - doris::segment_v2::InvertedIndexQueryType::MATCH_ALL_QUERY, - inverted_index_ctx); + std::vector<std::wstring> data_tokens; + if (array_offsets) { + for (auto next_src_array_offset = (*array_offsets)[i]; + current_src_array_offset < next_src_array_offset; ++current_src_array_offset) { + const auto& str_ref = string_col->get_data_at(current_src_array_offset); + std::vector<std::wstring> element_tokens = + doris::segment_v2::InvertedIndexReader::get_analyse_result( + column_name, str_ref.to_string(), + doris::segment_v2::InvertedIndexQueryType::MATCH_ALL_QUERY, + inverted_index_ctx); + data_tokens.insert(data_tokens.end(), element_tokens.begin(), element_tokens.end()); + } + } else { + const auto& str_ref = string_col->get_data_at(i); + data_tokens = doris::segment_v2::InvertedIndexReader::get_analyse_result( + column_name, str_ref.to_string(), + doris::segment_v2::InvertedIndexQueryType::MATCH_ALL_QUERY, inverted_index_ctx); Review Comment: Repeated code with MATCH_ANY? -- 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