ozgrakkurt opened a new issue, #7709:
URL: https://github.com/apache/arrow-rs/issues/7709
**Describe the bug**
The `View` inside the `BinaryView` arrays doesn't need to be represented as
u128.
Representing as u128 is a problem because it requires alignment >= 16 and
this is not strictly needed.
As an example, this is how polars-arrow defines it and it specifically
mentions u128 isn't used to avoid having a large alignment requirement.
```rust
#[repr(C)]
pub struct View {
/// The length of the string/bytes.
pub length: u32,
/// First 4 bytes of string/bytes data.
pub prefix: u32,
/// The buffer index.
pub buffer_idx: u32,
/// The offset into the buffer.
pub offset: u32,
}
```
https://docs.rs/polars-arrow/latest/src/polars_arrow/array/binview/view.rs.html
**Expected behavior**
alignment >= 16 requirement should be removed for BinaryView arrays when
doing FFI between other arrow libraries and arrow-rs
**Additional context**
The arrow spec doesn't define the view struct to have u128 representation,
it defines it like a regular struct that would have alignment requirement 4 in
a c representation.
https://arrow.apache.org/docs/format/Columnar.html#variable-size-binary-view-layout
--
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]