This is an automated email from the ASF dual-hosted git repository.
kxiao pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 0e248e35945 [fix](inverted index) Corrected the issue of
no_index_match failure caused by empty data #37947 (#38002)
0e248e35945 is described below
commit 0e248e359458a217b8b0932401f7c71c15331edd
Author: zzzxl <[email protected]>
AuthorDate: Thu Jul 18 10:04:36 2024 +0800
[fix](inverted index) Corrected the issue of no_index_match failure caused
by empty data #37947 (#38002)
---
be/src/vec/functions/match.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/be/src/vec/functions/match.cpp b/be/src/vec/functions/match.cpp
index eb4c1e3554b..95e973ae612 100644
--- a/be/src/vec/functions/match.cpp
+++ b/be/src/vec/functions/match.cpp
@@ -366,7 +366,12 @@ Status FunctionMatchPhrasePrefix::execute_match(
analyse_data_token(column_name, inverted_index_ctx,
string_col, i, array_offsets,
current_src_array_offset);
- for (size_t j = 0; j < data_tokens.size() - query_tokens.size() + 1;
j++) {
+ int32_t dis_count = data_tokens.size() - query_tokens.size();
+ if (dis_count < 0) {
+ continue;
+ }
+
+ for (size_t j = 0; j < dis_count + 1; j++) {
if (data_tokens[j] == query_tokens[0] || query_tokens.size() == 1)
{
bool match = true;
for (size_t k = 0; k < query_tokens.size(); k++) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]