Skip to content

fix(parquet): preserve dictionary index types - #1098

Merged
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/parquet-dictionary-index-type
Aug 7, 2026
Merged

fix(parquet): preserve dictionary index types#1098
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/parquet-dictionary-index-type

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

Parquet dictionary encoding uses int32 indexes, but stored Arrow schema metadata can specify a different dictionary index type. The schema restoration path currently hardcodes int32 and changes the dictionary type and index buffer width on read.

What changes are included in this PR?

Restore the stored index type and safely cast the reader indexes before rebuilding each dictionary array. Preserve dictionary values and the ordered flag.

Are these changes tested?

  • go test ./parquet/pqarrow -run TestArrowDictionaryTypePreservesIndexType -count=1

Are there any user-facing changes?

No API changes. This corrects the reported behavior while preserving the existing ownership and compatibility contracts.

@fallintoplace fallintoplace changed the title fix(parquet): preserve dictionary index types on read fix(parquet): restore dictionary index types Aug 5, 2026
@fallintoplace fallintoplace changed the title fix(parquet): restore dictionary index types fix(parquet): preserve dictionary index types Aug 6, 2026
@zeroshade

Copy link
Copy Markdown
Member

Nice catch!

@zeroshade
zeroshade merged commit 0a28b23 into apache:main Aug 7, 2026
35 of 44 checks passed
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.

2 participants