mrhhsg opened a new pull request, #68428:
URL: https://github.com/apache/doris/pull/68428
### What problem does this PR solve?
Issue Number: None
Repeated regular-expression searches rebuilt the unprocessed suffix as a new
input. This changed the meaning of beginning anchors: for example, `^a` could
match at every suffix position in `aaa` instead of only at the start of the
original string.
This change keeps the original input stable and advances RE2's search start
position for `regexp_count`, `regexp_extract_all`, `regexp_extract_all_array`,
and `split_by_regexp`. It also avoids rebuilding temporary suffix strings while
advancing repeated matches.
### Release note
Fix incorrect repeated matches for anchored regular expressions in
`regexp_count`, `regexp_extract_all`, `regexp_extract_all_array`, and
`split_by_regexp`.
### Check List (For Author)
- Test:
- Unit Test: `BUILD_TYPE=ASAN ./run-be-ut.sh --run
--filter='FunctionLikeTest.regexp_extract_all:FunctionLikeTest.regexp_extract_all_array:FunctionLikeTest.split_by_regexp_preserves_original_anchor:function_string_test.function_regexp_count_mixed_const_test'
-j 16`
- Regression test: generated the expected output with `-forceGenOut`,
then passed `BUILD_TYPE=ASAN doris-local-regression --network 10.26.20.3/24 all
-d query_p0/sql_functions/string_functions -s
test_regexp_repeated_search_anchor`
- Build: ASAN BE and FE build passed as part of the local regression
workflow
- Style: `build-support/check-format.sh` and
`build-support/check-build-hygiene.sh`
- Static analysis: `build-support/run-clang-tidy.sh` was attempted, but
the local toolchain stopped on existing diagnostics including a missing system
`stddef.h` and an unmatched `NOLINTEND` in `be/src/core/types.h`
- Behavior changed: Yes. Beginning anchors are evaluated relative to the
original input during repeated searches.
- Does this need documentation: No
--
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]