[Bug][QDP] Fix List<T> readers failing on nullable outer rows#1402
Merged
Conversation
rich7420
reviewed
Jun 15, 2026
| // All rows null but sample_size known from an earlier batch. | ||
| Some(ss) => ss, | ||
| // All rows null and sample_size unknown: skip batch. | ||
| None => continue, |
Contributor
There was a problem hiding this comment.
nit: In Reject mode, when the first batch is entirely null and sample_size is still unknown, None => continue returns before null_handling is consulted — so this batch is silently skipped instead of rejected. The batch ParquetReader errors on the same input, so the two readers diverge here. It's also the one Reject path without test coverage. Suggest either erroring on Reject here too, or documenting the difference explicitly.
Contributor
|
@0lai0 thanks for the patch! |
ryankert01
reviewed
Jun 15, 2026
guan404ming
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related Issues
Closes #1401
Part of #1338
Changes
Why
Reading a nullable
List<T>column with a null outer row (e.g.[[1, 2], null, [3, 4]]) fails with:InvalidInput("Inconsistent sample sizes: expected 2, got 0")Root cause: sample-size validation calls
ListArray::value_length(i)without checkingis_null(i). For a null outer row, Arrow returns 0, which the reader treats as a length-0 list.If a non-null row was seen first → validation fails with
expected N, got 0If the null row is row 0 → sample_size is seeded to 0 and corrupts all subsequent rows
This is pre-existing (not introduced by #1393) and affects three readers:
NullHandling::FillZerodoes not help because the failure happens at list-length validation, before value filling runs.How
Null outer row semantics
RejectInvalidInputwith a clear messageFillZerosample_sizezeros oncesample_sizeis knownsample_sizeunknownnum_samples) — e.g. leading all-null batch before any non-null row establishes sizeCode changes
ParquetReader(parquet.rs)is_null(i)guard in sample-size validation loopNullHandling)ParquetStreamingReader(parquet.rs)sample_sizefrom first non-null row instead of row 0.max(1)on sample-size divisor inread_batchArrowIPCReader(arrow_ipc.rs)Checklist