HappenLee opened a new pull request, #66788:
URL: https://github.com/apache/doris/pull/66788
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary:
Hyperscan can spend excessive time and memory compiling bounded repetitions
with large limits. This ports ClickHouse's interception threshold into Doris:
regex quantifiers above 50 are detected before Hyperscan compilation and
processed by RE2 instead.
The new `enable_hyperscan_fallback` session variable controls strictness. It
defaults to `true`, preserving fallback behavior. When set to `false`, Doris
returns the Hyperscan/interception error instead of falling back. Escaped
braces and braces inside character classes are masked before detection so regex
literals are not misclassified.
### Release note
Add `enable_hyperscan_fallback`. It defaults to `true`; setting it to
`false` returns an error when Hyperscan cannot compile or safely process the
regular expression.
### Check List (For Author)
- Test:
- Unit Test: `GLIBC_COMPATIBILITY=OFF ./run-be-ut.sh -j 48 --run
--filter=FunctionLikeTest.*` (36 passed)
- Unit Test: `DORIS_THIRDPARTY=$PWD/thirdparty ./run-fe-ut.sh --run
org.apache.doris.qe.SessionVariablesTest` (17 passed)
- Behavior changed: Yes. Expensive bounded repeats are intercepted before
Hyperscan compilation, and sessions may disable the RE2 fallback. The default
remains fallback enabled.
- 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]