Skip to content

fix(rust): require arrow >= 59 so FFI imports realign buffers - #5000

Open
felipecrv wants to merge 1 commit into
apache:mainfrom
felipecrv:automatic-buffer-realignment
Open

felipecrv wants to merge 1 commit into
apache:mainfrom
felipecrv:automatic-buffer-realignment

Conversation

@felipecrv

Copy link
Copy Markdown
Contributor

Drivers may export buffers that only meet the C Data Interface's recommended 8-byte alignment (and sometimes not even that), but arrow-rs requires 16-byte alignment for i128 (e.g. Decimal128). With arrow 58, importing such data through from_ffi or ArrowArrayStreamReader panics.

arrow 59 realigns under-aligned buffers on import (apache/arrow-rs#10030), so raise the minimum arrow version to 59 and add a regression test that imports an 8-byte-aligned Decimal128 buffer.

Closes #2526.

Drivers may export buffers that only meet the C Data Interface's
recommended 8-byte alignment, but arrow-rs requires 16-byte alignment
for i128 (e.g. Decimal128). With arrow 58, importing such data through
`from_ffi` or `ArrowArrayStreamReader` panics.

arrow 59 realigns under-aligned buffers on import (apache/arrow-rs#10030),
so raise the minimum arrow version to 59 and add a regression test that
imports an 8-byte-aligned Decimal128 buffer.

Closes apache#2526.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@felipecrv

Copy link
Copy Markdown
Contributor Author

I have no rush in merging this because it bumps the minimum Arrow requirement. It's really just a test and documentation of this problem we had in arrow-rs.

cc @lidavidm @zeroshade

@lidavidm

lidavidm commented Nov 8, 2026

Copy link
Copy Markdown
Member

I think I held back for a bit because of DataFusion. That said, 58.x still seems to get patch releases (it was included in the round of updates two weeks ago). Based on apache/arrow-rs#10349 it seems to be because Comet is still on 58.x.

@lidavidm

lidavidm commented Nov 8, 2026

Copy link
Copy Markdown
Member

Hmm, but they've since upgraded (apache/datafusion-comet@75fdddc). I think we may as well go ahead.

Comment thread rust/Cargo.toml
Comment on lines +39 to +41
# arrow >= 59 realigns under-aligned buffers imported through the C Data
# Interface (arrow-rs#10030). Older versions panic on buffers that are only
# 8-byte aligned (e.g. Decimal128 from JVM-based drivers).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# arrow >= 59 realigns under-aligned buffers imported through the C Data
# Interface (arrow-rs#10030). Older versions panic on buffers that are only
# 8-byte aligned (e.g. Decimal128 from JVM-based drivers).

I don't see why this needs to be called out all over the place.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rust: ADBC driver panics when consuming Arrow batches without properly aligned buffers

2 participants