xangelix opened a new issue, #12535:
URL: https://github.com/apache/arrow-rs/issues/12535

   ### Describe the bug
   
   Reading a Parquet column `s: Struct<l: FixedSizeList<UInt32 NOT NULL, 2> NOT 
NULL>` (the struct
   nullable) whose struct is null in some rows gives a `FixedSizeListArray` 
with no nulls of its own
   and null items in the rows where the struct is null. The item field is not 
nullable, so the array
   fails its own validation: `FixedSizeListArray::try_new` rejects it ("Found 
unmasked nulls for
   non-nullable FixedSizeListArray field \"item\""), and so do `take`, `concat` 
and `interleave` over
   the column. In arrow 59, `interleave` panicked instead. Any sort or merge in 
a query engine over
   such a column fails.
   
   ### To Reproduce
   
   Write `[{l: [1, 2]}, null, null]` with `ArrowWriter` and read it back with
   `ParquetRecordBatchReader`; then call `validate_full()` on the column, or 
`take` it. The test in
   the linked PR does exactly this.
   
   ### Expected behavior
   
   The list carries a null wherever an ancestor is null, so its null items are 
masked by the list and
   the list's nulls by the struct, and the array passes validation.
   
   ### Additional context
   
   `FixedSizeListArrayReader::consume_batch` inserts `fixed_size` null items 
for every row whose
   definition level is below the list's, but only builds a validity bitmap when 
the list itself is
   nullable. Variable-length lists don't hit this: the reader gives them 
zero-length entries.
   
   ### Willingness to contribute
   
   I plan to contribute a fix for this bug independently


-- 
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]

Reply via email to