pepijnve commented on code in PR #17839:
URL: https://github.com/apache/datafusion/pull/17839#discussion_r2402473640
##########
datafusion/functions/src/regex/regexplike.rs:
##########
@@ -153,6 +156,53 @@ impl ScalarUDFImpl for RegexpLikeFunc {
}
}
+ fn simplify(
+ &self,
+ args: Vec<Expr>,
+ info: &dyn SimplifyInfo,
+ ) -> Result<ExprSimplifyResult> {
+ // Try to simplify regexp_like to ~ or ~* if possible since the
implementation of those operators
+ // is more optimised.
+ let Some((st, op, re)) = (match args.as_slice() {
+ [string, regexp] => {
+ Some((string.clone(), Operator::RegexMatch, regexp.clone()))
Review Comment:
~I will check if that's possible~
Let me see if my Rust skills are good enough already.
--
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]