Skip to content

fix(parquet): leave null slots empty when dictionary reads fall back to plain values - #12333

Open
dayan02dev wants to merge 3 commits into
apache:mainfrom
dayan02dev:fix/7243
Open

dayan02dev wants to merge 3 commits into
apache:mainfrom
dayan02dev:fix/7243

Conversation

@dayan02dev

@dayan02dev dayan02dev commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

When a dictionary column's batch falls back to plain values (next row group's dictionary, or a PLAIN page), every buffered null slot is converted into a full copy of whatever key it happened to hold. With a large value followed by many nulls this overflows (index overflow decoding byte array, the issue's file) or silently inflates the batch (a 1 MB value + 400 nulls returns a 406 MB batch).

This is a different trigger from #7973 and #11478, where the real data exceeds the i32 offset range.

What changes are included in this PR?

  • DictionaryBuffer remembers the null mask from pad_nulls, and spill_values writes empty slots for nulls, as the existing comment there suggested.
  • Rebuilding a dictionary from plain values skips null slots, which keeps the rebuild as fast as before (the half-NULLs arrow_reader bench is ~13% faster).
  • The FixedSizeBinary conversion zero-fills empty slots.

Are these changes tested?

Yes, new and extended tests in arrow_reader/tests/column_reader.rs, dictionary_buffer.rs and tests/arrow_writer/roundtrip.rs.

Are there any significant user-facing changes?

No API changes. Dictionaries rebuilt from plain values no longer get an empty-string entry referenced only by null rows.

AI usage disclosure

Written with help from Claude Code. I read the full diff and ran the new tests locally; they fail on main and pass with this change.

@boring-cyborg boring-cyborg Bot added the parquet parquet crate label Nov 19, 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 error: index overflow decoding byte array

1 participant