Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bindings/c/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ license.workspace = true
version.workspace = true

[lib]
crate-type = ["cdylib", "staticlib"]
crate-type = ["cdylib", "staticlib", "rlib"]
doc = false

[dependencies]
paimon = { path = "../../crates/paimon" }
tokio = { workspace = true, features = ["rt-multi-thread"] }
futures = "0.3"
arrow = { workspace = true }
arrow-array = { workspace = true }
arrow-schema = { workspace = true }
1 change: 1 addition & 0 deletions bindings/c/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ impl paimon_error {
| paimon::Error::ColumnAlreadyExist { .. } => PaimonErrorCode::AlreadyExists,
paimon::Error::ConfigInvalid { .. }
| paimon::Error::DataTypeInvalid { .. }
| paimon::Error::DataInvalid { .. }
| paimon::Error::IdentifierInvalid { .. } => PaimonErrorCode::InvalidInput,
paimon::Error::IoUnexpected { .. } => PaimonErrorCode::IoError,
_ => PaimonErrorCode::Unexpected,
Expand Down
3 changes: 3 additions & 0 deletions bindings/c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ mod error;
mod identifier;
mod result;
mod table;
#[cfg(test)]
mod tests;
mod types;
mod write;

use std::sync::OnceLock;
use tokio::runtime::Runtime;
Expand Down
26 changes: 26 additions & 0 deletions bindings/c/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,29 @@ pub struct paimon_result_next_batch {
pub batch: paimon_arrow_batch,
pub error: *mut paimon_error,
}

// === Write/Commit result types ===

#[repr(C)]
pub struct paimon_result_write_builder {
pub write_builder: *mut paimon_write_builder,
pub error: *mut paimon_error,
}

#[repr(C)]
pub struct paimon_result_table_write {
pub write: *mut paimon_table_write,
pub error: *mut paimon_error,
}

#[repr(C)]
pub struct paimon_result_table_commit {
pub commit: *mut paimon_table_commit,
pub error: *mut paimon_error,
}

#[repr(C)]
pub struct paimon_result_prepare_commit {
pub messages: *mut paimon_commit_messages,
pub error: *mut paimon_error,
}
Loading
Loading