[WIP] fix: read Dict(FixedSizeBinary) from parquet without dict encoding#10232
Draft
Jefffrey wants to merge 1 commit into
Draft
[WIP] fix: read Dict(FixedSizeBinary) from parquet without dict encoding#10232Jefffrey wants to merge 1 commit into
Dict(FixedSizeBinary) from parquet without dict encoding#10232Jefffrey wants to merge 1 commit into
Conversation
Jefffrey
commented
Jun 29, 2026
| let data = DictionaryArray::<K>::new(keys, Arc::new(values)); | ||
| let batch = RecordBatch::try_new(Arc::new(schema), vec![Arc::new(data)]).unwrap(); | ||
| let data = Arc::new(DictionaryArray::<K>::new(keys, Arc::new(values))) as ArrayRef; | ||
| one_column_roundtrip(Arc::clone(&data), true); |
Contributor
Author
There was a problem hiding this comment.
From the reproduction, added one_column_roundtrip() usage here to test roundtrip where one of the cases is disabling dictionary encoding entirely
Rest of test changes is just restructuring
| ArrowType::Dictionary(k, v) => (k, v.as_ref().clone()), | ||
| _ => unreachable!(), | ||
| }; | ||
| let array = if let ArrowType::FixedSizeBinary(size) = value_type { |
Contributor
Author
There was a problem hiding this comment.
Matching what was done above in the Self::Dict path:
arrow-rs/parquet/src/arrow/buffer/dictionary_buffer.rs
Lines 159 to 168 in 7616e10
- as introduced originally by feat: Support round trip reading/writing Arrow type
Dictionary(_, FixedSizeBinary(_))to Parquet #7446
This is because values.into_array() assumed a generic byte offset array:
arrow-rs/parquet/src/arrow/buffer/offset_buffer.rs
Lines 132 to 146 in 7616e10
Which is the wrong structure for a fixedsizebinary array (we don't have offsets buffer, etc.)
Dict(FixedSizeBinary) from parquet without dict encodingDict(FixedSizeBinary) from parquet without dict encoding
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
If a column
Dictionary(FixedSizeBinary)was written to a parquet file, but with dictionary encoding turned off (so encoded only asPLAIN), then reading that file back into aDictionary(FixedSizeBinary)lead to an unavoidable panic so roundtrip was not possible. Fixing this bug.What changes are included in this PR?
Coerce the binary values to fixedsizebinary when reading from non-dictionary encoded values to ensure array construction is respected.
Are these changes tested?
Yes, added new tests.
Are there any user-facing changes?
No.