feat: implement is_null method for DictionaryArray and TypedDictionar… #7608
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?
Closes #7607.
Rationale for this change
Previously, the
is_null
method onDictionaryArray
only considered nulls in the keys buffer, which could result in inaccurate null reporting when the dictionary values themselves contained nulls. This change ensures that nulls are correctly propagated by also checking the referenced value in the dictionary array.Accurately reflecting null semantics is essential for correctness in downstream operations such as filtering, joins, and aggregations.
What changes are included in this PR?
is_null
method inDictionaryArray
that checks both the key and its referenced value.TypedDictionaryArray
to delegate to the dictionary'sis_null
.test_is_null_considers_dictionary_values
to verify the combined null behavior in both raw and typed dictionary arrays.Are there any user-facing changes?
Yes, this changes the behavior of
is_null
forDictionaryArray
andTypedDictionaryArray
. Users relying on the previous behavior (which only checked key nulls) may observe different results if dictionary values contain nulls.This aligns the behavior more closely with expected null propagation semantics but should be considered a behavioral fix that might impact some logic in downstream code.