feat(c): add write/commit C FFI bindings#522
Open
suxiaogang223 wants to merge 3 commits into
Open
Conversation
Add write-side C FFI bindings following the existing read-side patterns: API surface (14 functions): - WriteBuilder: new_write_builder, free, with_overwrite, new_write, new_commit - TableWrite: free, write_arrow_batch (via Arrow C Data Interface), prepare_commit - TableCommit: free, commit, overwrite, truncate_table, abort - CommitMessages: free Tests (15 cases): - Read path: empty table read, data read, column projection - Predicate: equal, IS NOT NULL, IS IN, less_than filter, AND combinator - Write path: builder lifecycle, full roundtrip, multiple batches, empty commit, overwrite mode, truncate, abort - Error handling: null pointer checks - Integration: two commits with same builder Design follows Python bindings: in-process commit message transfer, shared commit_user between writer and committer, Arrow C Data Interface for zero-copy batch import. Closes apache#520
QuakeWang
reviewed
Jul 14, 2026
Member
Author
|
Thanks for the detailed review, @QuakeWang! I added regression tests to reproduce each of the issues you pointed out and confirmed the failures before making the fixes. The new tests now cover Arrow C Data ownership, invalid and schema-mismatched batches, commit message provenance and lifetime, index cleanup on abort, and caller-provided commit identity with idempotent retries. Everything is passing now, including the full paimon-c test suite and the targeted core tests. The fixes are in 27a9d90. When you get a chance, could you please take another look? Thanks! |
Contributor
|
No issue from me. |
QuakeWang
requested changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add write-side C FFI bindings (
bindings/c/src/write.rs) following the same opaque handle /extern "C"patterns as the existing read-side bindings. Closes #520.API surface (14 functions)
Design decisions
FFI_ArrowArray/FFI_ArrowSchemaraw pointersTests (15 cases, all passing)
Run:
cargo +1.91.0 test -p paimon-c