HappenLee commented on code in PR #66788:
URL: https://github.com/apache/doris/pull/66788#discussion_r3785472269
##########
be/src/exprs/function/like.cpp:
##########
@@ -487,8 +596,21 @@ Status FunctionLikeBase::regexp_fn(const LikeSearchState*
state, const ColumnStr
}
// hyperscan compile expression to database and allocate scratch space
+bool FunctionLikeBase::should_fallback_to_re2(std::string_view regexp) {
+ static const SlowWithHyperscanChecker slow_with_hyperscan_checker;
+ return slow_with_hyperscan_checker.is_slow(regexp);
+}
+
Status FunctionLikeBase::hs_prepare(FunctionContext* context, const char*
expression,
hs_database_t** database, hs_scratch_t**
scratch) {
+ if (should_fallback_to_re2(expression)) {
Review Comment:
it's ok, keep the logic
--
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]