Struct deltalake::DeltaTransaction [−][src]
pub struct DeltaTransaction<'a> { /* fields omitted */ }
Expand description
Object representing a delta transaction.
Clients that do not need to mutate action content in case a transaction conflict is encountered
may use the commit
method and rely on optimistic concurrency to determine the
appropriate Delta version number for a commit. A good example of this type of client is an
append only client that does not need to maintain transaction state with external systems.
Clients that may need to do conflict resolution if the Delta version changes should use
the prepare_commit
and try_commit_transaction
methods and manage the Delta version
themselves so that they can resolve data conflicts that may occur between Delta versions.
Please not that in case of non-retryable error the temporary commit file such as
_delta_log/_commit_<uuid>.json
will orphaned in storage.
Implementations
Creates a new delta transaction.
Holds a mutable reference to the delta table to prevent outside mutation while a transaction commit is in progress.
Transaction behavior may be customized by passing an instance of DeltaTransactionOptions
.
Add an arbitrary “action” to the actions associated with this transaction
Add an arbitrary number of actions to the actions associated with this transaction
Create a new add action and write the given bytes to the storage backend as a fully formed Parquet file
add_file accepts two optional parameters:
partitions: an ordered vec of WritablePartitionValues for the file to be added actions: an ordered list of Actions to be inserted into the log file ahead of the Add action for the file added. This should typically be used for txn type actions
pub async fn commit(
&mut self,
_operation: Option<DeltaOperation>
) -> Result<DeltaDataTypeVersion, DeltaTransactionError>
pub async fn commit(
&mut self,
_operation: Option<DeltaOperation>
) -> Result<DeltaDataTypeVersion, DeltaTransactionError>
Commits the given actions to the delta log.
This method will retry the transaction commit based on the value of max_retry_commit_attempts
set in DeltaTransactionOptions
.
pub async fn prepare_commit(
&self,
_operation: Option<DeltaOperation>
) -> Result<PreparedCommit, DeltaTransactionError>
pub async fn prepare_commit(
&self,
_operation: Option<DeltaOperation>
) -> Result<PreparedCommit, DeltaTransactionError>
Low-level transaction API. Creates a temporary commit file. Once created,
the transaction object could be dropped and the actual commit could be executed
with DeltaTable.try_commit_transaction
.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for DeltaTransaction<'a>
impl<'a> Send for DeltaTransaction<'a>
impl<'a> Sync for DeltaTransaction<'a>
impl<'a> Unpin for DeltaTransaction<'a>
impl<'a> !UnwindSafe for DeltaTransaction<'a>