Skip to content

feat(parquet): provide direct access to dictionary pages - #10420

Open
DarkWanderer wants to merge 3 commits into
apache:mainfrom
DarkWanderer:get-dictionary
Open

feat(parquet): provide direct access to dictionary pages#10420
DarkWanderer wants to merge 3 commits into
apache:mainfrom
DarkWanderer:get-dictionary

Conversation

@DarkWanderer

@DarkWanderer DarkWanderer commented Jul 23, 2026

Copy link
Copy Markdown

Which issue does this PR close?

Rationale for this change

This change provides low-level API necessary for enabling dictionary-based pruning in DataFusion: apache/datafusion#23851

What changes are included in this PR?

  • parquet::file::metadata::dictionary::decode_dictionary_page: decodes
    a BYTE_ARRAY dictionary page (Thrift header parse, decompress, PLAIN
    decode) into a Utf8/Binary Arrow array.
  • ParquetMetaDataReader::read_column_dictionary (sync) and
    read_column_dictionary_async (async) to fetch and decode a given row group/column's dictionary page from a ParquetMetaData, returning Ok(None) if the chunk has no dictionary page.
  • ParquetRecordBatchStreamBuilder::get_row_group_column_dictionary convenience method mirroring get_row_group_column_bloom_filter.

Are these changes tested?

Yes: a round-trip unit test for a dictionary-encoded string column, a
non-BYTE_ARRAY rejection test, and sync + async reader tests that
decode a real dictionary page written through ArrowWriter.

Are there any user-facing changes?

Yes, three new public APIs (see above). No changes to
existing API.

@github-actions github-actions Bot added the parquet Changes to the parquet crate label Jul 23, 2026
@DarkWanderer DarkWanderer changed the title feat(parquet): decode dictionary pages independent of the array reader feat(parquet): provide direct access to dictionary pages Jul 23, 2026
Add sync and async APIs for decoding a BYTE_ARRAY column chunk dictionary page without materializing the full column, enabling exact row-group membership pruning for fully dictionary-encoded chunks.

Reuse the regular page reader header, size validation, and decryption path so standalone dictionary decoding handles encrypted, truncated, and malformed pages safely.

See apache#9010.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@DarkWanderer
DarkWanderer marked this pull request as ready for review July 24, 2026 08:22
@alamb

alamb commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Thanks @DarkWanderer -- I think it would help to have some sort of example here that shows the "usecase" of these APIs -- so either a test or something in parquet-examples that shows how these new APIs are meant to be used

i see that apache/datafusion#23851 is sort of an example but I think we should distill the use down to something just arrow-rs specific so the API is clear

Does that makes sense?

@DarkWanderer

DarkWanderer commented Aug 15, 2026

Copy link
Copy Markdown
Author

Thank you for review @alamb

Yes, this makes sense. I have added a test in async_reader module - does this match what you had in mind? Alternatively, happy to add a separate example parallel to parquet/examples/read_with_rowgroup.rs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable access to column dictionaries in async reader

2 participants