Skip to content

fix(parquet): return an error when a skip runs out of repetition levels - #12500

Open
linyiru wants to merge 1 commit into
apache:mainfrom
linyiru:fix-skip-records-insufficient-rep-levels
Open

linyiru wants to merge 1 commit into
apache:mainfrom
linyiru:fix-skip-records-insufficient-rep-levels

Conversation

@linyiru

@linyiru linyiru commented Nov 29, 2026

Copy link
Copy Markdown

Which issue does this PR close?

Rationale for this change

GenericColumnReader::skip_records does not return when a data page of a repeated column declares more values than it has repetition levels. skip_rep_levels returns (0, 0) once the levels run out, and nothing else in the loop advances. read_records returns an error for the same page since #6232.

What changes are included in this PR?

skip_records returns Insufficient repetition levels read from column when skip_rep_levels reads no record and no level, the same check and message as in read_records.

Are these changes tested?

Yes. test_skip_records_insufficient_rep_levels reads and skips a page with two repetition levels that declares four values, and expects the same error from both. Without the fix the skip does not return.

Are there any significant user-facing changes?

No. A skip that did not terminate now returns an error.

AI usage disclosure

Claude Code found the problem while fuzzing the reader with corrupted files, and generated the fix, the test and this description. The test was run on main with and without the fix.

🤖 Generated with Claude Code

skip_records looped forever on a page that declares more values than it has repetition levels. read_records already returns an error for such a page; the skip path now returns the same one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@boring-cyborg boring-cyborg Bot added the parquet parquet crate label Nov 29, 2026
@rynewang

rynewang commented Dec 4, 2026

Copy link
Copy Markdown

Thanks for fixing this! I hit the same hang, and this PR fixes it for me. One regression: skipping over an empty data page (num_values = 0) in a repeated column now returns an error. With an empty V1 page followed by a valid 10-value page, skip_records(5) returns Ok(5) on main, but "Insufficient repetition levels read from column" with this change.

Adding && remaining_levels != 0 to the new check fixes it. It may be worth a test case too.

(Found and tested with AI assistance.)

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: skip_records loops forever when a page has fewer repetition levels than it declares

2 participants