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 commit_with_identifier(
&self,
commit_messages: Vec<CommitMessage>,
commit_identifier: i64,
) -> Result<()>
pub async fn commit_with_identifier( &self, commit_messages: Vec<CommitMessage>, commit_identifier: i64, ) -> Result<()>
Commit new files with a caller-provided commit identifier.
Identifiers must increase monotonically for a given commit_user.
All messages for one identifier must be submitted in a single call.
This method does not filter previously committed identifiers. Use
Self::filter_and_commit_with_identifier when retrying an uncertain
commit result.
Sourcepub async fn filter_and_commit_with_identifier(
&self,
commit_messages: Vec<CommitMessage>,
commit_identifier: i64,
) -> Result<()>
pub async fn filter_and_commit_with_identifier( &self, commit_messages: Vec<CommitMessage>, commit_identifier: i64, ) -> Result<()>
Filter a previously committed identifier, then commit if it is new.
Identifiers must increase monotonically for a given commit_user. This
method is intended for retrying the same uncertain result; regular
commits should use Self::commit_with_identifier.
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 overwrite_with_identifier(
&self,
commit_messages: Vec<CommitMessage>,
static_partitions: Option<HashMap<String, Option<Datum>>>,
commit_identifier: i64,
) -> Result<()>
pub async fn overwrite_with_identifier( &self, commit_messages: Vec<CommitMessage>, static_partitions: Option<HashMap<String, Option<Datum>>>, commit_identifier: i64, ) -> Result<()>
Overwrite partitions with a caller-provided commit identifier.
A previously committed identifier is filtered so retrying an uncertain result cannot re-execute the destructive operation.
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_partitions_with_identifier(
&self,
partitions: Vec<HashMap<String, Option<Datum>>>,
commit_identifier: i64,
) -> Result<()>
pub async fn truncate_partitions_with_identifier( &self, partitions: Vec<HashMap<String, Option<Datum>>>, commit_identifier: i64, ) -> Result<()>
Drop specific partitions with a caller-provided commit identifier.
A previously committed identifier is filtered so retrying an uncertain result cannot delete data committed in between.
Sourcepub async fn drop_partitions(
&self,
partitions: Vec<HashMap<String, Option<Datum>>>,
) -> Result<()>
pub async fn drop_partitions( &self, partitions: Vec<HashMap<String, Option<Datum>>>, ) -> Result<()>
Python-compatible alias for dropping partitions.
Sourcepub async fn drop_partitions_with_identifier(
&self,
partitions: Vec<HashMap<String, Option<Datum>>>,
commit_identifier: i64,
) -> Result<()>
pub async fn drop_partitions_with_identifier( &self, partitions: Vec<HashMap<String, Option<Datum>>>, commit_identifier: i64, ) -> Result<()>
Python-compatible alias for dropping partitions with a caller-provided
commit identifier. Unlike truncate_partitions, an empty partition list
is rejected just like FileStoreCommit.drop_partitions.
Sourcepub async fn truncate_table(&self) -> Result<()>
pub async fn truncate_table(&self) -> Result<()>
Truncate the entire table (OVERWRITE with no filter, only deletes).
Sourcepub async fn truncate_table_with_identifier(
&self,
commit_identifier: i64,
) -> Result<()>
pub async fn truncate_table_with_identifier( &self, commit_identifier: i64, ) -> Result<()>
Truncate the entire table with a caller-provided commit identifier.
A previously committed identifier is filtered so retrying an uncertain result cannot delete data committed in between.
Sourcepub async fn abort(&self, commit_messages: &[CommitMessage]) -> Result<()>
pub async fn abort(&self, commit_messages: &[CommitMessage]) -> Result<()>
Abort a prepared commit by deleting newly written data, changelog and index files.
Deletion is best-effort and mirrors Python FileStoreCommit.abort: missing
files or storage errors are ignored so abort cleanup never masks the
original write failure.
Auto Trait Implementations§
impl !RefUnwindSafe for TableCommit
impl !UnwindSafe for TableCommit
impl Freeze for TableCommit
impl Send for TableCommit
impl Sync for TableCommit
impl Unpin for TableCommit
impl UnsafeUnpin for TableCommit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.