kou commented on code in PR #40970:
URL: https://github.com/apache/arrow/pull/40970#discussion_r1556417544
##########
cpp/src/gandiva/regex_functions_holder.cc:
##########
@@ -118,24 +119,13 @@ Result<std::shared_ptr<LikeHolder>>
LikeHolder::Make(const FunctionNode& node) {
Status::Invalid(
"'like' function requires a string literal as the third
parameter"));
return Make(std::get<std::string>(literal->holder()),
- std::get<std::string>(escape_char->holder()));
+ std::get<std::string>(escape_char->holder()), regex_op);
}
}
-Result<std::shared_ptr<LikeHolder>> LikeHolder::Make(const std::string&
sql_pattern) {
- std::string pcre_pattern;
- ARROW_RETURN_NOT_OK(RegexUtil::SqlLikePatternToPcre(sql_pattern,
pcre_pattern));
-
- auto lholder = std::shared_ptr<LikeHolder>(new LikeHolder(pcre_pattern));
- ARROW_RETURN_IF(!lholder->regex_.ok(),
- Status::Invalid("Building RE2 pattern '", pcre_pattern,
- "' failed with: ", lholder->regex_.error()));
-
- return lholder;
-}
Review Comment:
Why do we need to remove this?
##########
cpp/src/gandiva/regex_functions_holder.cc:
##########
@@ -99,13 +99,14 @@ Result<std::shared_ptr<LikeHolder>> LikeHolder::Make(const
FunctionNode& node) {
"'like' function requires a string literal as the second
parameter"));
RE2::Options regex_op;
+ regex_op.set_dot_nl(true); // set dotall mode for the regex.
Review Comment:
This breaks backward compatibility, right?
Can we keep backward compatibility?
--
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]