xangelix opened a new pull request, #12536:
URL: https://github.com/apache/arrow-rs/pull/12536
# Which issue does this PR close?
- Closes #12535
# Rationale for this change
A required `FixedSizeList` inside a nullable struct reads back from Parquet
as an array that fails its own validation: the list has no nulls, but its
required items are null in the rows where the struct is null. `take`, `concat`
and `interleave` over the column then return "Found unmasked nulls for
non-nullable FixedSizeListArray field", so a sort or merge over a table with
this shape fails.
# What changes are included in this PR?
`FixedSizeListArrayReader::consume_batch` already inserts `fixed_size` null
items for each row whose definition level shows an ancestor is null. It now
also builds the list's validity bitmap when that happens, even though the list
itself is required. The null items are then masked by the list, and the list's
nulls by the ancestor, which `StructArray` allows for a non-nullable child.
Nothing changes for nullable lists, or for required lists with no null
ancestor.
# Are these changes tested?
Yes: `test_required_list_under_nullable_struct` writes `[{l: [1, 2]}, null,
null]`, reads it back, validates the column and the list, and runs `take`,
`concat` and `interleave` over it. It fails without the change.
# Are there any significant user-facing changes?
A required fixed-size list under a null ancestor now reads with nulls in
those rows instead of an invalid array.
# AI usage disclosure
Yes-- AI has been assisting us with migrating away from an older system /
different rust library, to datafusion. Running our old test suite against
arrow-rs and datafusion, this is one of the issues our tests found.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]