diff --git a/internal/core/src/exec/expression/UnaryExpr.cpp b/internal/core/src/exec/expression/UnaryExpr.cpp index dfcbfe7b12058..0b446f6df7f54 100644 --- a/internal/core/src/exec/expression/UnaryExpr.cpp +++ b/internal/core/src/exec/expression/UnaryExpr.cpp @@ -396,8 +396,18 @@ PhyUnaryRangeFilterExpr::ExecRangeVisitorImplArray(OffsetVector* input) { break; } case proto::plan::Match: { - UnaryElementFuncForArray func; - func(data, valid_data, size, val, index, res, valid_res); + UnaryElementFuncForArray + func; + func(data, + valid_data, + size, + val, + index, + res, + valid_res, + offsets); break; } default: diff --git a/internal/core/src/exec/expression/UnaryExpr.h b/internal/core/src/exec/expression/UnaryExpr.h index f47c2f299d474..ee8593a1fd251 100644 --- a/internal/core/src/exec/expression/UnaryExpr.h +++ b/internal/core/src/exec/expression/UnaryExpr.h @@ -212,14 +212,15 @@ struct UnaryElementFuncForArray { if constexpr (std::is_same_v) { res[i] = false; } else { - if (index >= src[i].length()) { + if (index >= src[offset].length()) { res[i] = false; continue; } PatternMatchTranslator translator; auto regex_pattern = translator(val); RegexMatcher matcher(regex_pattern); - auto array_data = src[i].template get_data(index); + auto array_data = + src[offset].template get_data(index); res[i] = matcher(array_data); } } else {