Weijun-H opened a new pull request, #10342:
URL: https://github.com/apache/arrow-rs/pull/10342
# Which issue does this PR close?
- Closes #10341.
# Rationale for this change
Downstream memory accounting sometimes needs to measure the allocated
capacity currently retained by Arrow array builders, including allocation slack
after buffer growth. Existing slice accessors expose initialized data, but not
the underlying values, offsets, or validity-buffer capacity.
# What changes are included in this PR?
This adds read-only capacity accessors for existing builder internals:
- `GenericByteBuilder::{values_capacity, offsets_capacity,
validity_capacity}`
- `GenericListBuilder::{offsets_capacity, validity_capacity}`
- `PrimitiveBuilder::validity_capacity`
- `StructBuilder::validity_capacity`
The methods only read existing builder state and do not change append,
reserve, finish, or resize behavior.
# Are these changes tested?
No behavior-specific tests are added because these methods only expose
existing capacity fields through read-only forwarding accessors. Existing
arrow-array builder tests were run unchanged, and the new public API is
compile-checked by the crate.
Validated with:
- `cargo fmt --all -- --check`
- `cargo test -p arrow-array builder --lib`
- `cargo test -p arrow-array --lib`
- `cargo +1.96.0 clippy -p arrow-array --all-targets --no-deps -- -D
warnings`
# Are there any user-facing changes?
Yes. This adds public read-only capacity accessors on Arrow array builders.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]