Skip to content

GH-4011: Fail on records that start with a non-zero repetition level - #4012

Open
shivadarshan-devadiga wants to merge 1 commit into
apache:masterfrom
shivadarshan-devadiga:GH-4011-record-start-repetition-level
Open

shivadarshan-devadiga wants to merge 1 commit into
apache:masterfrom
shivadarshan-devadiga:GH-4011-record-start-repetition-level

Conversation

@shivadarshan-devadiga

Copy link
Copy Markdown
Contributor

Rationale for this change

Fixes #4011. With invalid repetition levels, the record reader assembles wrong records and drops values without an error, for example on parquet-testing's bad_data/ARROW-GH-45185.parquet.

What changes are included in this PR?

RecordReaderImplementation.read() checks that every repeated column is at repetition level 0 when a record starts, and throws a ParquetDecodingException otherwise. Each record visits every column at least once, so the check costs one comparison per repeated column per record.

Are these changes tested?

Yes. TestColumnIO.testReadFailsOnRecordStartingWithNonZeroRepetitionLevel writes a page like the one in ARROW-GH-45185.parquet; it fails without the change. parquet-column (1311 tests) and parquet-avro (418) pass. Reading all parquet-testing files, only ARROW-GH-45185.parquet changes: it now fails.

Are there any user-facing changes?

Files with such levels now fail to read instead of returning wrong rows.

Closes #4011

@shivadarshan-devadiga

Copy link
Copy Markdown
Contributor Author

@Fokko @wgtmac Can you please take a look whenever you get a moment? Thanks!

@shivadarshan-devadiga
shivadarshan-devadiga force-pushed the GH-4011-record-start-repetition-level branch from 84e8305 to 682d207 Compare December 3, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record reader silently drops values when a record starts with a non-zero repetition level

1 participant