-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 25 : Adding support for regex_replace and regex_match #122
Conversation
d534dcc
to
0cdc7c0
Compare
00ee61a
to
fe4acd4
Compare
0ec3b1b
to
3d43b0c
Compare
b143822
to
d3db0a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple small notes and rebasing on master.
arroyo-sql/src/expressions.rs
Outdated
@@ -2041,8 +2085,7 @@ impl StringFunction { | |||
}) | |||
} | |||
} | |||
StringFunction::RegexpMatch(_, _) => todo!(), | |||
StringFunction::RegexpReplace(_, _, _, _, _) => todo!(), | |||
StringFunction::RegexpReplace(_, _, _, _) => unreachable!(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd clarify this is the Some(_)
in the fourth argument case here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with 9889c37
use std::error::Error; | ||
|
||
#[test] | ||
pub fn test_regexp_match_is_correct() -> Result<(), Box<dyn Error>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general you don't need to have return types on your tests. Either it panics or it passes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with 9889c37
I am normally more used to work with functional errors rather than panics, that's why I naturally leaned on using results
Solves #25
This pull requests add regexp_match and regexp_replace as defined in DataFusion signature.
Please note that the DataFusion signature is different from the PostgresSQL for what concerns the regexp_replace. In particular, the start and N parameters defined below are not supported