-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: issue_9285: port builtin reg function into datafusion-function-* (1/3 regexpmatch) #9329
Conversation
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.
Thank you very much @Lordworms -- this PR looks great to me and it is very close I think. I left some small suggestions and then I think this will be ready to go
use std::sync::Arc; | ||
|
||
#[cfg(feature = "regex_expressions")] | ||
macro_rules! invoke_on_array_if_regex_expressions_feature_flag { |
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 don't think these macros are needed here because the entire module is not included if the regex_expressions
module is not compiled in.
regexp::regexp_match(values, regex, Some(flags)) | ||
.map_err(|e| arrow_datafusion_err!(e)) | ||
} | ||
other => internal_err!( |
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.
other => internal_err!( | |
other => exec_err!( |
|
||
Ok(()) | ||
} | ||
// #[test] |
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.
It looks to me like regexp_match is already tested in https://github.com/apache/arrow-datafusion/blob/c439bc73b6a9ba9efa4c8a9b5d2fb6111e660e74/datafusion/sqllogictest/test_files/regexp.slt#L128-L215 so I think we can simply remove this test
Bonus points would be to port it to .slt
(there is no reason to leave it in and commented out)
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 would port it to .slt
@@ -536,7 +536,7 @@ impl From<&protobuf::ScalarFunction> for BuiltinScalarFunction { | |||
ScalarFunction::Lpad => Self::Lpad, | |||
ScalarFunction::Random => Self::Random, | |||
ScalarFunction::RegexpLike => Self::RegexpLike, | |||
ScalarFunction::RegexpMatch => Self::RegexpMatch, | |||
//ScalarFunction::RegexpMatch => Self::RegexpMatch, |
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.
//ScalarFunction::RegexpMatch => Self::RegexpMatch, |
I think removing it entirely would be better
@@ -1518,7 +1518,7 @@ impl TryFrom<&BuiltinScalarFunction> for protobuf::ScalarFunction { | |||
BuiltinScalarFunction::Random => Self::Random, | |||
BuiltinScalarFunction::Uuid => Self::Uuid, | |||
BuiltinScalarFunction::RegexpLike => Self::RegexpLike, | |||
BuiltinScalarFunction::RegexpMatch => Self::RegexpMatch, | |||
//BuiltinScalarFunction::RegexpMatch => Self::RegexpMatch, |
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.
//BuiltinScalarFunction::RegexpMatch => Self::RegexpMatch, |
Got it, I will fix this later today |
13a7425
to
c3e3a87
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.
Thank you @Lordworms - this looks great to me
…* crate (1/3: RegexpMatch part)
Which issue does this PR close?
#9328
Closes #.
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?