You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Jefffrey (via GitHub)" <gi...@apache.org> on 2026/06/29 02:41:20 UTC
[PR] fix: read `Dict(FixedSizeBinary)` from parquet without dict encoding [arrow-rs]
Jefffrey opened a new pull request, #10232:
URL: https://github.com/apache/arrow-rs/pull/10232
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax.
-->
- Closes #9247
# Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
If a column `Dictionary(FixedSizeBinary)` was written to a parquet file, but with dictionary encoding turned off (so encoded only as `PLAIN`), then reading that file back into a `Dictionary(FixedSizeBinary)` lead to an unavoidable panic so roundtrip was not possible. Fixing this bug.
# What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes 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?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
If this PR claims a performance improvement, please include evidence such as benchmark results.
-->
Yes, added new tests.
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
If there are any breaking changes to public APIs, please call them out.
-->
No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] fix: read `Dict(FixedSizeBinary)` from parquet without dict encoding [arrow-rs]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #10232: [WIP] fix: read `Dict(FixedSizeBinary)` from parquet without dict encoding
URL: https://github.com/apache/arrow-rs/pull/10232
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: read `Dict(FixedSizeBinary)` from parquet without dict encoding [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on code in PR #10232:
URL: https://github.com/apache/arrow-rs/pull/10232#discussion_r3489050023
##########
parquet/src/arrow/buffer/dictionary_buffer.rs:
##########
@@ -185,8 +185,18 @@ impl<K: ArrowNativeType + Ord, V: OffsetSizeTrait> DictionaryBuffer<K, V> {
ArrowType::Dictionary(k, v) => (k, v.as_ref().clone()),
_ => unreachable!(),
};
+ let array = if let ArrowType::FixedSizeBinary(size) = value_type {
Review Comment:
Matching what was done above in the `Self::Dict` path:
https://github.com/apache/arrow-rs/blob/7616e10f12894232eacb807993e55427a067d061/parquet/src/arrow/buffer/dictionary_buffer.rs#L159-L168
- as introduced originally by https://github.com/apache/arrow-rs/pull/7446
This is because `values.into_array()` assumed a generic byte offset array:
https://github.com/apache/arrow-rs/blob/7616e10f12894232eacb807993e55427a067d061/parquet/src/arrow/buffer/offset_buffer.rs#L132-L146
Which is the wrong structure for a fixedsizebinary array (we don't have offsets buffer, etc.)
##########
parquet/src/arrow/arrow_writer/mod.rs:
##########
@@ -2954,8 +2944,12 @@ mod tests {
)
.unwrap();
- 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);
Review 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] fix: read `Dict(FixedSizeBinary)` from parquet without dict encoding [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on PR #10232:
URL: https://github.com/apache/arrow-rs/pull/10232#issuecomment-4912253474
references for myself
- https://github.com/apache/arrow-rs/pull/7446
- https://github.com/apache/arrow-rs/issues/8250
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] fix: read `Dict(FixedSizeBinary)` from parquet without dict encoding [arrow-rs]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10232:
URL: https://github.com/apache/arrow-rs/pull/10232#issuecomment-5563891862
Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org