You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Weijun-H (via GitHub)" <gi...@apache.org> on 2026/07/14 14:28:29 UTC
[PR] Expose builder buffer capacity accessors [arrow-rs]
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Expose builder buffer capacity accessors [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey merged PR #10342:
URL: https://github.com/apache/arrow-rs/pull/10342
--
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] Expose builder buffer capacity accessors [arrow-rs]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on PR #10342:
URL: https://github.com/apache/arrow-rs/pull/10342#issuecomment-4999763877
thanks @Weijun-H, @rluvaton & @Rich-T-kid
--
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