Skip to main content

Module transaction

Module transaction 

Source
Expand description

This module contains transaction api.

The transaction API enables changes to be made to an existing table.

Note that this may also have side effects, such as producing new manifest files.

Below is a basic example using the “fast-append” action:

use iceberg::transaction::{ApplyTransactionAction, Transaction};
use iceberg::Catalog;

// Create a transaction.
let tx = Transaction::new(my_table);

// Create a `FastAppendAction` which will not rewrite or append
// to existing metadata. This will create a new manifest.
let action = tx.fast_append().add_data_files(my_data_files);

// Apply the fast-append action to the given transaction, returning
// the newly updated `Transaction`.
let tx = action.apply(tx).unwrap();


// End the transaction by committing to an `iceberg::Catalog`
// implementation. This will cause a table update to occur.
let table = tx
    .commit(&some_catalog_impl)
    .await
    .unwrap();

Structs§

ActionCommit
The result of committing a TransactionAction.
AddColumn
Declarative specification for adding a column in an UpdateSchemaAction.
ExpireSnapshotsAction
A transaction action that removes snapshots from table metadata.
FastAppendAction
FastAppendAction is a transaction action for fast append data files to the table.
ReplaceSortOrderAction
Transaction action for replacing sort order.
Transaction
Table transaction.
UpdateLocationAction
A transaction action that sets or updates the location of a table.
UpdatePropertiesAction
A transactional action that updates or removes table properties
UpdateSchemaAction
Schema evolution API modeled after the Java SchemaUpdate implementation.
UpdateStatisticsAction
A transactional action for updating statistics files in a table
UpgradeFormatVersionAction
A transaction action to upgrade a table’s format version.

Traits§

ApplyTransactionAction
A helper trait for applying a TransactionAction to a Transaction.