AndreaBozzo commented on code in PR #12010:
URL: https://github.com/apache/arrow-rs/pull/12010#discussion_r4465621652
##########
arrow-array/src/ffi.rs:
##########
@@ -1778,6 +1786,74 @@ mod tests_from_ffi {
Ok(())
}
+ /// Offsets that a producer stores at an address not aligned for their
type must
+ /// import, as the C data interface only recommends alignment.
+ ///
+ /// <https://github.com/apache/arrow-rs/issues/7136>
+ #[test]
+ fn test_bytes_with_unaligned_offsets() -> Result<()> {
+ // The C layout of `FFI_ArrowArray`, filled in by hand as a C producer
would.
+ #[repr(C)]
+ struct RawArrowArray {
Review Comment:
Mostly the second: `ArrayDataBuilder::build` rejects the misaligned offsets,
and `build_unchecked` still validates under `force_validate`. The #10034 test
gets around it by building `FixedSizeBinary` and importing as `Decimal128`, but
there's no such pun for byte array offsets, and `FFI_ArrowArray`'s fields are
private, so the test fills in the C struct itself, which is also what a C
producer hands over.
--
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]