Skip to content

GH-184: Add Arrow C Data Interface import foundation#603

Open
samtalki wants to merge 1 commit into
apache:mainfrom
samtalki:agent/cdata-import-foundation
Open

GH-184: Add Arrow C Data Interface import foundation#603
samtalki wants to merge 1 commit into
apache:mainfrom
samtalki:agent/cdata-import-foundation

Conversation

@samtalki

@samtalki samtalki commented Jul 6, 2026

Copy link
Copy Markdown

Refs #184.

Adds the import foundation for the Arrow C Data Interface:

  • ABI compatible ArrowSchema and ArrowArray definitions with layout coverage.
  • Arrow.from_c_data, Arrow.from_c_data_table, and Arrow.release_c_data.
  • Zero copy import for null, boolean, numeric primitive arrays, root struct tables, and metadata.
  • Release ownership, use after release checks, and explicit materialization with copy/collect.
  • Validation for malformed primitive and struct inputs before derived unsafe reads.

This intentionally leaves broader type support and export support for follow up PRs.

Validation:

  • 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 was used and the generated changes were reviewed before submission.

Generated-by: OpenAI Codex

@codecov-commenter

codecov-commenter commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.37349% with 69 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.93%. Comparing base (3712291) to head (3b5999e).
⚠️ Report is 54 commits behind head on main.

Files with missing lines Patch % Lines
src/cdata.jl 83.29% 69 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #603      +/-   ##
==========================================
- Coverage   87.43%   86.93%   -0.51%     
==========================================
  Files          26       28       +2     
  Lines        3288     3797     +509     
==========================================
+ Hits         2875     3301     +426     
- Misses        413      496      +83     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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
@samtalki samtalki force-pushed the agent/cdata-import-foundation branch from 3b5999e to 6c0b4b8 Compare July 6, 2026 23:51
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.

2 participants