Skip to content

fix(parquet): give a required FixedSizeList nulls under a null ancestor - #12536

Open
xangelix wants to merge 1 commit into
apache:mainfrom
xangelix:fix/fixed-size-list-under-null-struct
Open

xangelix wants to merge 1 commit into
apache:mainfrom
xangelix:fix/fixed-size-list-under-null-struct

Conversation

@xangelix

@xangelix xangelix commented Dec 2, 2026

Copy link
Copy Markdown

Which issue does this PR close?

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.

A required fixed-size list inside a nullable struct read back as a list
with no nulls of its own whose required items held nulls under the null
structs. That array fails FixedSizeListArray's own validation, so take,
concat and interleave over the column return an error (and interleave
panicked in arrow 59).

When an ancestor is null for some rows, build the list's validity bitmap
even though the list itself is required. The null items are then masked
by the list, and the list's nulls by the ancestor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boring-cyborg boring-cyborg Bot added the parquet parquet crate label Dec 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parquet parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parquet reader: a required FixedSizeList inside a nullable struct reads as an array that fails validation

1 participant