felipecrv commented on PR #7137:
URL: https://github.com/apache/arrow-rs/pull/7137#issuecomment-2661046691

   > I wonder if we could make this behaviour opt-in
   
   I considered that, but couldn't think of any scenario where a Rust program 
importing data from another system would not want to make sure the buffers are 
aligned. And note that buffers are checked already, that's how the panic is 
triggered after all.
   
   > I would not expect an FFI interface to be silently reallocating memory 
buffers without being explicitly asked to do so
   
   It's important to consider here that reallocation won't happen if the 
producer is a good citizen and produces aligned buffers already. Often by 
reallocation on their side as well. That's what I think is being currently 
implemented in the C++ implementation of Flight. The buffers coming from gRPC 
can't possibly be aligned according to Arrow types so no matter who performs 
the copy for alignment, it will have to be done at least once.
   
   > _Returning an error instead of panicking would be a reasonable parallel 
improvement_
   
   I can't see how that error could be handled at a higher level layer
   
   


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