bit2swaz opened a new pull request, #10798:
URL: https://github.com/apache/arrow-rs/pull/10798

   # Which issue does this PR close?
   
   - Closes #10034.
   
   # Rationale for this change
   
   `from_ffi` realigned under-aligned C Data Interface buffers (e.g. an 8-byte 
aligned `Decimal128` from a JVM producer) *after* `consume()`. under 
`force_validate`, `consume()`'s `build()` validates first and rejects the 
buffer before the realign runs, so spec-legal input errors. reachable via the 
`arrow` crate with `features = ["force_validate", "ffi"]` calling 
`arrow::ffi::from_ffi`.
   
   # What changes are included in this PR?
   
   - `ImportedArrowArray::consume` builds through `ArrayDataBuilder` with 
`align_buffers(true)` before validation, matching `arrow-ipc`'s 
`create_array_from_builder`
   - dropped the now-redundant outer `align_buffers()` calls in `from_ffi` / 
`from_ffi_and_data_type`.
   
   # Are these changes tested?
   
   covered by `test_decimal128_under_aligned_round_trip`. the issue suggested 
ungating it under `force_validate`, but that isn't possible as its fixture is a 
misaligned `ArrayData` built with `build_unchecked`, which validates under 
`force_validate` and so rejects the input at construction, before `from_ffi` 
runs. the gate stays with a comment explaining why
   
   # Are there any user-facing changes?
   
   no public API change. behavior only changes under `force_validate`, where 
spec-legal under-aligned input is realigned instead of erroring.


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