-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add regexp_like, improve docs and examples for
regexp_match`
#9137
Conversation
FYI - the prettier error is not something I see on my machine
|
regexp_like, regexp_match, regexp_replace, | ||
}; | ||
|
||
fn data(rng: &mut ThreadRng) -> StringArray { |
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.
that bench is really needed taking into account how much probs we had with regex performance
make_scalar_function_inner(func)(args) | ||
} | ||
other => { | ||
internal_err!("Unsupported data type {other:?} for function regexp_like") |
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.
internal_err!("Unsupported data type {other:?} for function regexp_like") | |
exec_err!("Unsupported data type {other:?} for function regexp_like") |
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.
There is quite a few instances in the code that have this pattern (I was mirroring the existing regexp_... functions there) - I was going to create a followup PR that fixes them across the whole code base
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.
That would be most appreciated. Cleaning up internal errors that are possible to trigger via incrrect queries (rather than a bug) is very good improvement
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.
…d the test data to a csv file.
regexp_like
and regexp_match
scalar functions
regexp_like
and regexp_match
scalar functionsregexp_like, improve docs and examples for
regexp_match`
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.
🤯 -- this PR is amazing. Thank you so much @Omega359
The thoroughness of test coverage and documentation should serve as a model best practice.
- [`flight_sql_server.rs`](examples/flight/flight_sql_server.rs): Run DataFusion as a standalone process and execute SQL queries from JDBC clients | ||
- [`make_date.rs`](examples/make_date.rs): Examples of using the make_date function |
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 🙏
@@ -0,0 +1,303 @@ | |||
# Licensed to the Apache Software Foundation (ASF) under one |
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 -- this is much better
return plan_err!("regexp_like() does not support the \"global\" option"); | ||
} | ||
|
||
let array = arrow_string::regexp::regexp_is_match_utf8(values, regex, Some(flags)) |
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.
👍
|
||
// use dataframe and regexp_like function to test col 'values', against patterns in col 'patterns' with flags | ||
let df = ctx | ||
assert_batches_eq!( |
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.
👍
Thanks again @Omega359 |
Which issue does this PR close?
Closes #9102
Rationale for this change
Add a new regexp_like function.
What changes are included in this PR?
Code, tests, documentation, perf test
Are these changes tested?
Yes,
Are there any user-facing changes?
A new regexp_like function is available for use.