feat(spark): add base64 and unbase64 functions#19968
Merged
comphead merged 11 commits intoapache:mainfrom Jan 26, 2026
Merged
Conversation
cht42
commented
Jan 24, 2026
| @@ -19,7 +19,7 @@ extern crate criterion; | |||
|
|
|||
Contributor
Author
There was a problem hiding this comment.
this benchmark was broken beacuse of input/output type mismatch
cht42
commented
Jan 24, 2026
|
|
||
| match self { | ||
| Self::Base64 => { | ||
| Self::Base64 | Self::Base64Padded => { |
cht42
commented
Jan 24, 2026
|
|
||
| fn return_field_from_args(&self, args: ReturnFieldArgs<'_>) -> Result<FieldRef> { | ||
| let [bin] = take_function_args(self.name(), args.arg_fields)?; | ||
| let return_type = match bin.data_type() { |
Contributor
Author
There was a problem hiding this comment.
matching return type with DF encode function
cht42
commented
Jan 24, 2026
|
|
||
| fn return_field_from_args(&self, args: ReturnFieldArgs<'_>) -> Result<FieldRef> { | ||
| let [str] = take_function_args(self.name(), args.arg_fields)?; | ||
| let return_type = match str.data_type() { |
Contributor
Author
There was a problem hiding this comment.
matching return type with DF decode function
Jefffrey
reviewed
Jan 24, 2026
… constant definition
Jefffrey
reviewed
Jan 24, 2026
…ve error messages in unbase64 function
comphead
reviewed
Jan 25, 2026
| } | ||
|
|
||
| fn invoke_with_args(&self, _args: ScalarFunctionArgs) -> Result<ColumnarValue> { | ||
| exec_err!("{} should have been simplified", self.name()) |
Contributor
There was a problem hiding this comment.
if it fires, the error message would be highly confusing IMO
Jefffrey
approved these changes
Jan 26, 2026
de-bgunter
pushed a commit
to de-bgunter/datafusion
that referenced
this pull request
Mar 24, 2026
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes apache#123` indicates that this PR will close issue apache#123. --> - Closes apache#19967 - Part of apache#15914 ## Rationale for this change Add spark compatible base64/unbase64 functions ## What changes are included in this PR? - new encoding mode in DF encoding UDF for padded base64 - spark udfs for base64/unbase64 ## Are these changes tested? yes in SLT ## Are there any user-facing changes? yes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
datafusion-sparkSpark Compatible Functions #15914Rationale for this change
Add spark compatible base64/unbase64 functions
What changes are included in this PR?
Are these changes tested?
yes in SLT
Are there any user-facing changes?
yes