pub struct TableCommit { /* private fields */ }Expand description
Table commit logic for Paimon write operations.
Provides atomic commit functionality including append, overwrite and truncate
Implementations§
Source§impl TableCommit
impl TableCommit
pub fn new(table: Table, commit_user: String) -> Self
Sourcepub async fn commit(&self, commit_messages: Vec<CommitMessage>) -> Result<()>
pub async fn commit(&self, commit_messages: Vec<CommitMessage>) -> Result<()>
Commit new files in APPEND mode.
Sourcepub async fn overwrite(
&self,
commit_messages: Vec<CommitMessage>,
static_partitions: Option<HashMap<String, Option<Datum>>>,
) -> Result<()>
pub async fn overwrite( &self, commit_messages: Vec<CommitMessage>, static_partitions: Option<HashMap<String, Option<Datum>>>, ) -> Result<()>
Overwrite partitions with new data.
When static_partitions is None, extracts the set of partitions
touched by commit_messages and overwrites only those (dynamic partition overwrite).
When static_partitions is Some, uses the caller-provided partition spec
to determine which partitions to replace (static partition overwrite).
A partial spec (not all partition keys specified) uses predicate-based filtering
so that all matching partitions are overwritten.
For unpartitioned tables this is a full table overwrite.
When static_partitions is Some but commit_messages is empty,
the specified partitions are truncated (all existing data removed, nothing written).
Sourcepub async fn truncate_partitions(
&self,
partitions: Vec<HashMap<String, Option<Datum>>>,
) -> Result<()>
pub async fn truncate_partitions( &self, partitions: Vec<HashMap<String, Option<Datum>>>, ) -> Result<()>
Drop specific partitions (OVERWRITE with only deletes).
Sourcepub async fn truncate_table(&self) -> Result<()>
pub async fn truncate_table(&self) -> Result<()>
Truncate the entire table (OVERWRITE with no filter, only deletes).