alamb opened a new pull request, #9155: URL: https://github.com/apache/arrow-rs/pull/9155
# Which issue does this PR close? - Part of https://github.com/apache/arrow-rs/issues/9128 - Follow on to https://github.com/apache/arrow-rs/pull/9120 # Rationale for this change I am trying to encourage people to avoid using ArrayData when constructing arrays (as it is slower than just creating the arrays directly). Part of doing so is ensuring that the APIs to create the necessary pieces (NullBuffers in particular) are easy to use / well documented. As pointed out by @scovich on https://github.com/apache/arrow-rs/pull/9120#issuecomment-3739126785, it is 1. Not obvious how `finish` works (resets the builder) 2. Why there is no `build` method (when there is a From impl) Thus, let's add `build` methods to `NullBufferBuilder` and document the difference between `finish` and `build` While I was working on this change, I noticed the same issue with `BufferBuilder` and `BooleanBufferBuilder` so I also made them consistent # What changes are included in this PR? 1. Improve docs and Add build() method to {Null,Boolean,}BufferBuilder # Are these changes tested? Yes by CI and new doc examples # 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. --> -- 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]
