Rust syntax error

7
closed
willeagren
willeagren
Posted 2 months ago

Rust syntax error #3

One way to resolve this is to include the Arrow dependency and utilizing the FFI_ArrowSchema struct; which should map to the C struct ArrowSchema declared in /api/ARROW_C_DATA_INTERFACE.h

Or is there another way to define this struct across the languages? FFI should do this.

willeagren
willeagren
Created 2 months ago

" //! Contains declarations to bind to the C Data Interface. //! //! Generally, this module is divided in two main interfaces: //! One interface maps C ABI to native Rust types, i.e. convert c-pointers, c_char, to native rust. //! This is handled by [FFI_ArrowSchema] and [FFI_ArrowArray]. "

https://docs.rs/arrow/3.0.0/src/arrow/ffi.rs.html#18-822

So it should resolve it; however, when adding arrow v23.0.0 as dependency and compiling Cargo can't find FFI inside the arrow crate... Can't find anything online about this. Please help.

willeagren
willeagren
Created 2 months ago

Yes, the FFI_ArrowSchema is precisely what we want to be calling; as the doc refers to the underlying ABI compatible struct that we define in /api/ARROW_C_DATA_INTERFACE.h

But Cargo can't find FFI in the scope of using the Arrow crate... frustrating. Perhaps simply using the regular ArrowSchema will work?, since it implements the same traits as the FFI struct.

willeagren
willeagren
Created 2 months ago

The official Arrow crate seems broken, ffi can't be found anywhere but in the documentation. Luckily, there is an ongoing rewrite project, Arrow2 that lets us compile with the ffi::ArrowSchema, that should map directly to our C ABI compatible struct! Will double check...

Ignalina
Ignalina
Created 2 months ago

ok :) V23 sounds like the Rust impl .. im used with V9 which is the C++ version , i will read your comments again :)

willeagren
willeagren
Created 2 months ago

Ah ok, perhaps the Arrow v9.0.0 Crate has access to the correct FFI module. Will investigate later today! If so; will create new PR

willeagren
willeagren
Created 2 months ago

I tested really quick, not extensively, and compiling with Apache Arrow v9.0.0 Crate works, which seems really strange, since the Crate versions should be backwards compatible... Perhaps there was something wrong with my rustup installation yesterday on the Pi 4. Will test more later today, on multiple systems.

willeagren
willeagren
Created 2 months ago

Using the v9.1.0 Arrow Crate resolves the compilation issues, since FFI is found in the namespace of arrow::*; even though we can't get it to work on latest Arrow crate version, I will close this issue.