Repository navigation
fix(parquet): honor requested dictionary value type - #12126
Closed
Rich-T-kid wants to merge 1 commit into
Closed
Rich-T-kid wants to merge 1 commit into
Rich-T-kid wants to merge 1 commit into
Conversation
Rich-T-kid
marked this pull request as draft
November 8, 2026 18:12
Rich-T-kid
force-pushed
the
rich-T-kid/parquet-dictionary-requested-value-type
branch
from
November 8, 2026 18:18
ea86d97 to
80e9f66
Compare
Rich-T-kid
force-pushed
the
rich-T-kid/parquet-dictionary-requested-value-type
branch
from
November 8, 2026 18:24
80e9f66 to
83ae72c
Compare
Rich-T-kid
marked this pull request as ready for review
November 8, 2026 19:13
Rich-T-kid
marked this pull request as draft
November 8, 2026 19:18
Rich-T-kid
marked this pull request as ready for review
November 8, 2026 19:20
Rich-T-kid
marked this pull request as draft
November 8, 2026 19:34
Contributor
Author
|
Biggest query-level improvements in the dedicated runs:
|
Rich-T-kid
marked this pull request as ready for review
November 8, 2026 20:05
Contributor
Author
|
DataFusion E2E A/B: apache/datafusion#27249, comparing Arrow parent
Largest wins were TPC-DS Q72 (1573.84 → 1411.64 ms, -10.3%), TPC-DS Q74 (236.38 → 221.98 ms, -6.1%), and ClickBench Q39 (296.02 → 278.66 ms, -5.9%). The largest regression was TPC-DS Q28 (57.62 → 61.94 ms, +7.5%). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
An unannotated Parquet
BYTE_ARRAYis inferred as ArrowBinary, even when a supplied reader schema requestsDictionary<K, Utf8>. The dictionary reader currently chooses its value type from the Parquet annotation, so it producesDictionary<K, Binary>. DataFusion must then discard the encoded representation and rebuild it row by row:This matters for DataFusion's cost-based dictionary encoding (CBDE) work in apache/datafusion#24111. CBDE can only benefit from the Parquet dictionary when the scan preserves it in the requested logical string type:
Without this reader support, the scan pays the expansion and rebuild cost before CBDE can use the dictionary.
What changes are included in this PR?
Decode dictionary pages using their physical Parquet value type, then convert only the distinct values to the value type requested by the supplied Arrow schema:
The converted dictionary values are reused across batches, producing
Dictionary<K, Utf8>directly without expanding the keys. Plain-encoded pages continue to use the existing dictionary-building fallback.The same path handles compatible string/binary and view-type requests, including UTF-8 validation when a binary dictionary is requested as a string dictionary.
Are these changes tested?
Yes. Regression tests cover:
Dictionary<Int32, Utf8>across multiple batchesDataFusion validation
Are there any significant user-facing changes?
Supplied dictionary schemas now produce columns with the requested compatible string or binary value type. There are no public API changes.