tustvold commented on PR #6616:
URL: https://github.com/apache/arrow-rs/pull/6616#issuecomment-2433553042

   > Do we need to document / test the various kernels and operations that 
guarantee no part of the input array would be reused 🤔
   > Maybe we should better document that the arrow-rs kernels / 
implementations all assume immutable buffers
   
   We do have the beginnings of the docs here - 
https://docs.rs/arrow-array/latest/arrow_array/#zero-copy-slicing
   
   But we could definitely document better that the array abstractions, and by 
extension the kernels that operate on them, are built around reference counted 
immutable buffers, and implementations should not make any **assumptions** 
about sole ownership of buffers. If codepaths require sole ownership they must 
use the safe APIs for doing so, such as 
[into_mutable](https://docs.rs/arrow-buffer/latest/arrow_buffer/buffer/struct.Buffer.html#method.into_mutable).
   
   > What can be assumed about the output of a function given it got an 
ArrayRef in
   
   Tbh I am a little confused why one would make any assumptions here, but it 
certainly couldn't hurt to document that we avoid allocating whenever possible.


-- 
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]

Reply via email to