fix: don't generate nulls for Decimal128 and Decimal256 when field is non-nullable and have non-zero null_density#9046
Merged
alamb merged 2 commits intoapache:mainfrom Dec 30, 2025
Conversation
… non-nullable and have non-zero null_density
rluvaton
commented
Dec 25, 2025
| // For dictionary it handle the nullability internally | ||
| if !field.data_type().is_nested() && !matches!(field.data_type(), Dictionary(_, _)) { | ||
| // Override null density with 0.0 if the array is non-nullable | ||
| null_density = match field.is_nullable() { |
Member
Author
There was a problem hiding this comment.
overriding this instead of making the decimal use primitive_null_density to avoid future problems like this
Jefffrey
approved these changes
Dec 26, 2025
Contributor
Jefffrey
left a comment
There was a problem hiding this comment.
I notice we're missing the arms for Decimal32 and Decimal64 here too
Contributor
Maybe we can fix this as a follow on PR |
Contributor
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?
N/A
Rationale for this change
if decimal field is non nullable and have null density we should not have nulls in the genrated array
What changes are included in this PR?
Override
null_densityfor non nested and non dictionary to avoid future problems like thisadded assertion and test
Are these changes tested?
yes
Are there any user-facing changes?
working generate for
Decimal128andDecimal256