zhangxinyao88 opened a new pull request, #10867: URL: https://github.com/apache/arrow-rs/pull/10867
# Which issue does this PR close? - Part of #10245. # Rationale for this change This replaces another remaining `BufferBuilder` callsite listed in #10245. Using `Vec` for the converted offsets avoids the builder overhead. # What changes are included in this PR? `cast_byte_container` now collects converted offsets in a `Vec<TO::Offset>` and converts it directly into an Arrow `Buffer`. # Are these changes tested? Yes: - `cargo fmt --all -- --check` - `cargo test -p arrow-cast` — 375 unit tests and 11 doc tests passed - `cargo clippy -p arrow-cast --all-targets --all-features -- -D warnings` Existing string and binary cast tests cover the changed path, so no new tests were added. A temporary local Criterion benchmark for a 512-row `Utf8` to `LargeUtf8` cast produced: | | Time | | --- | ---: | | `main` | 504.35 ns | | This PR | 403.76 ns | Criterion reported a 19.9% improvement. # Are there any user-facing changes? No. # AI assistance Codex was used to identify the callsite, prepare the focused refactor, run validation and benchmarking, and draft this description. -- 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]
