Skip to content

Instantly share code, notes, and snippets.

@wesm
Created April 2, 2020 01:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wesm/d48908018c4b7a0d9789a31d10caf525 to your computer and use it in GitHub Desktop.
Save wesm/d48908018c4b7a0d9789a31d10caf525 to your computer and use it in GitHub Desktop.
Example of round-tripping Arrow data through the new C ABI/Interface
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sa-
Copy link

sa- commented Apr 15, 2021

Where is arrow_c defined?

@wesm
Copy link
Author

wesm commented Apr 15, 2021

@sa-
Copy link

sa- commented Apr 16, 2021

Hey Wes!

I think this solves it actually:

c_schema = ffi.new("struct ArrowSchema*")
c_schema_ptr = int(ffi.cast("uintptr_t", c_schema))

# NB: RecordBatch is packed as a StructArray
c_batch = arrow_c.new("struct ArrowArray*") # I think arrow_c is meant to be ffi here
c_batch_ptr = int(ffi.cast("uintptr_t", c_batch))

I'm working to make the C Data Interface work with Arrow.jl :)

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