Skip to content

GH-184: Export Arrow arrays through the C Data Interface#605

Draft
samtalki wants to merge 3 commits into
apache:mainfrom
samtalki:agent/cdata-export
Draft

GH-184: Export Arrow arrays through the C Data Interface#605
samtalki wants to merge 3 commits into
apache:mainfrom
samtalki:agent/cdata-export

Conversation

@samtalki

@samtalki samtalki commented Jul 6, 2026

Copy link
Copy Markdown

Refs #184

Depends on #603 and #604. Do not merge before both PRs land.

Incremental review diff: samtalki/arrow-julia@agent/cdata-import-breadth-v2...agent/cdata-export

This adds C Data export support on top of the broader importer:

  • Arrow.to_c_data for Arrow arrays and Tables.jl column tables
  • independent schema and array owners so releasing schema does not invalidate live array buffers
  • release callbacks that clear release pointers and keep moved child schema and array copies usable until their own release
  • format emission, children, metadata, exported buffers, and round trips through the importer where supported

Verification:

  • julia --project=. -e 'using Arrow, Test, Tables, DataAPI; include("test/cdata.jl")'
  • julia --project=. --check-bounds=yes -e 'using Arrow, Test, Tables, DataAPI; include("test/cdata.jl")'
  • julia --project=. -e 'using Pkg; Pkg.test()'
  • julia --project=. -e 'using Pkg; Pkg.test(; julia_args=["--check-bounds=yes"])'
  • git diff --check upstream/main...HEAD

AI assistance: Generated with OpenAI Codex and reviewed for licensing and unsafe code concerns.

Incremental size note: relative to predecessor #604, this PR is 3 files changed, +1118/-2 diff lines, net +1116. GitHub may show the larger unmerged stack diff until #603 and #604 land.

samtalki and others added 3 commits July 6, 2026 19:51
Add ArrowSchema and ArrowArray ABI structs plus C Data import for null and primitive arrays. Root struct arrays are exposed as Tables.jl column tables with DataAPI metadata.

Add validation for pointer layout, child counts, buffers, offset arithmetic, metadata bounds, dictionary pointer consistency, release idempotency, and reads after release.

Keep aligned imported buffers rooted behind a shared owner, and mirror arrow-rs by copying misaligned fixed width buffers into aligned storage before typed access. The copy and collect methods materialize Julia owned arrays.

Adjust dictionary encoding offsets for non 1-based reference pools so categorical pools with missing values keep correct dictionary indices.

Co-authored-by: Robert Buessow <robert.buessow@relational.ai>
Co-authored-by: Olle Martensson <olle.martensson@gmail.com>
Generated-by: OpenAI Codex
Add import support for boolean, string, binary, list, fixed size, temporal, timestamp, duration, interval, and decimal C Data formats. Extend malformed input, offset, null count, release, copy, collect, metadata, and GC rooting coverage for the broader importer.

Co-authored-by: Robert Buessow <robert.buessow@relational.ai>

Co-authored-by: Olle Martensson <olle.martensson@gmail.com>

Generated-by: OpenAI Codex
Add array and table export entry points with independent schema and array owners.

Cover primitive and struct round trips, release order, moved child ownership, GC, metadata, malformed layout, unsupported export cases, and exported buffer layout checks for nested, string, and fixed size arrays.

Co-authored-by: Robert Buessow <robert.buessow@relational.ai>
Co-authored-by: Olle Martensson <olle.martensson@gmail.com>
Generated-by: OpenAI Codex
@samtalki samtalki force-pushed the agent/cdata-export branch from fbd422a to 26667a7 Compare July 7, 2026 00:13
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.

1 participant