-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat(datafusion-spark): implement spark compatible unhex function
#19909
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
Conversation
| I: Iterator<Item = Option<T>>, | ||
| T: AsRef<str>, | ||
| { | ||
| let mut builder = BinaryBuilder::with_capacity(len, len * 32); |
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.
Why 32?
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 was chosen based on benchmark results and seemed like a reasonable initial estimate. Thanks for pointing this out, for StringArray and LargeStringArray we can use a more accurate capacity from values().len(). I’ve updated the code accordingly.
|
Thanks for the review and for pointing this out. I’ve updated the implementation accordingly, and the tests have been updated as well and added to the STLs. |
|
🚀 |
Which issue does this PR close?
Part of: #15914
Rationale for this change
Implement spark compatible unhex functions:
https://spark.apache.org/docs/latest/api/sql/index.html#unhex
What changes are included in this PR?
Are these changes tested?
Yes. UTs and SLT added.
Are there any user-facing changes?
No.