Hi; If you have odd sized Vec<T> it is not possible to get a zero-copy array with Arrow. Since you will access to non allocated memory region if you try to get a zero-copy view on that. What you will receive at the end of your buffer will be some garbage bytes (not mentioning UB and ownership of the data and such when overwritten in your next operation). In Rust arrow, you get different byte alignments for your target_arch. So there is no strict rule about alignments, but it is mostly 64 bytes.
Best, Mahmut Bulut On Jul 22, 2020, at 11:01, Ritchie Vink <ritchi...@gmail.com> wrote: > > Hey all, > > Is it possible in any way to go from a Rust Vec<T> to an Arrow buffer. I > know the alignments of arrow memory is 8 or 64 bits and this isn't the case > for Rust's Vec type. Could we instantiate a Vec in any way such that a zero > copy PrimitiveArray is possible? > > Thanks in advance, > > Ritchie Vink > >