This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/main by this push:
new c961d6ea2c Perf: create dictionary reader config and default
unsafeflag to false (#10260)
c961d6ea2c is described below
commit c961d6ea2cb0e12684c70ca8aa2a5b2656039a17
Author: RIchard Baah <[email protected]>
AuthorDate: Tue Jul 7 18:57:26 2026 -0400
Perf: create dictionary reader config and default unsafeflag to false
(#10260)
# 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 #10255.
# Rationale for this change
`FlightDataDecoder.skip_validation` does not get propagated to `
arrow_ipc::reader::read_dictionary()`, the flag is hardcoded to false.
This causes validation checks even when this isn't what the caller
wants.
<!--
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.
-->
# What changes are included in this PR?
commit #/1:
- new `arrow_ipc::reader::DictionaryConfig` thats holds the message
version as well as the `unsafeFlag`
- `DictionaryConfig` contains a builder method to set `skip_validation`
this gets passed into `read_dictionary_impl` for reads
- Breaking API change for downstream consumers
- see
https://github.com/apache/arrow-rs/pull/10260#issuecomment-4861761466
<!--
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.
-->
# Are these changes tested?
yes.
<!--
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.
-->
# Are there any user-facing changes?
view
https://github.com/apache/arrow-rs/pull/10260#issuecomment-4861761466
<!--
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.
-->
---
arrow-flight/src/decode.rs | 4 +++-
arrow-ipc/src/reader.rs | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/arrow-flight/src/decode.rs b/arrow-flight/src/decode.rs
index 756603b844..b0fc3da26d 100644
--- a/arrow-flight/src/decode.rs
+++ b/arrow-flight/src/decode.rs
@@ -308,12 +308,14 @@ impl FlightDataDecoder {
)
})?;
- arrow_ipc::reader::read_dictionary(
+ arrow_ipc::reader::read_dictionary_impl(
&buffer,
dictionary_batch,
&state.schema,
&mut state.dictionaries_by_field,
&message.version(),
+ false,
+ self.skip_validation.clone(),
)
.map_err(|e| {
FlightError::DecodeError(format!("Error decoding ipc
dictionary: {e}"))
diff --git a/arrow-ipc/src/reader.rs b/arrow-ipc/src/reader.rs
index 5ee7da2015..09eabd2f7e 100644
--- a/arrow-ipc/src/reader.rs
+++ b/arrow-ipc/src/reader.rs
@@ -798,7 +798,8 @@ pub fn read_dictionary(
)
}
-fn read_dictionary_impl(
+/// Low-level version of [`read_dictionary`] with alignment and validation
controls
+pub fn read_dictionary_impl(
buf: &Buffer,
batch: crate::DictionaryBatch,
schema: &Schema,