StructArray::try_new validation incorrectly returns an error when logical_nulls()
returns Some() && null_count == 0
#7435
Labels
logical_nulls()
returns Some() && null_count == 0
#7435
Describe the bug
This logic in StructArray::try_new validates that if one of the child arrays in the StructArray has a null value that isn't properly masked by the parent, then it will be rejected with the error
Found unmasked nulls for non-nullable StructArray field
.However, it is possible for
a.logical_nulls()
to returnSome(_)
and theNullBuffer
itself to report that there aren't any nulls (null_count == 0
), which leads StructArray::try_new to incorrectly report that it found unmasked nulls.To Reproduce
Expected behavior
The validation succeeds.
Additional context
I will raise a PR for this fix shortly.
The text was updated successfully, but these errors were encountered: