Repository navigation
fix(spark): return NULL from char for a NULL scalar argument - #26126
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26126 +/- ##
========================================
Coverage 82.73% 82.73%
========================================
Files 1147 1147
Lines 449389 449541 +152
Branches 449389 449541 +152
========================================
+ Hits 371788 371923 +135
- Misses 54943 54944 +1
- Partials 22658 22674 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
neilconway
approved these changes
Oct 8, 2026
neilconway
left a comment
Contributor
There was a problem hiding this comment.
Thanks @ranflarion! lgtm.
I notice that we don't declare is_strict for char, or indeed any of the other Spark UDFs. That would be good to do at some point but is orthogonal.
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?
charfails on a NULL scalar argument #26125.Rationale for this change
SELECT char(NULL::INT)fails withExecution error: The argument must be an Int64 array or scalar.where Spark returns NULL. NULL rows of an array argument already return NULL, only a NULL scalar argument reaches the error.What changes are included in this PR?
spark_chrreturns a NULLUtf8scalar for a NULLInt64scalar.What is the testing strategy for this PR?
A
char(NULL::INT)case inspark/string/char.slt, which fails on main with the error above.Are there any user-facing changes?
charof a NULL scalar returns NULL instead of an error.