iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
iceberg::Transaction Class Reference

A transaction for performing multiple updates to a table. More...

#include <transaction.h>

Inheritance diagram for iceberg::Transaction:

Public Member Functions

const std::shared_ptr< Table > & table () const
 Return the Table that this transaction will update.
 
const TableMetadatabase () const
 Returns the base metadata without any changes.
 
const TableMetadatacurrent () const
 Return the current metadata with staged changes applied.
 
std::string MetadataFileLocation (std::string_view filename) const
 Return the location of the metadata file with the given filename.
 
Result< std::shared_ptr< Table > > Commit ()
 Apply the pending changes from all actions and commit.
 
Result< std::shared_ptr< UpdatePartitionSpec > > NewUpdatePartitionSpec ()
 Create a new UpdatePartitionSpec to update the partition spec of this table and commit the changes.
 
Result< std::shared_ptr< UpdateProperties > > NewUpdateProperties ()
 Create a new UpdateProperties to update table properties and commit the changes.
 
Result< std::shared_ptr< UpdateSortOrder > > NewUpdateSortOrder ()
 Create a new UpdateSortOrder to update the table sort order and commit the changes.
 
Result< std::shared_ptr< UpdateSchema > > NewUpdateSchema ()
 Create a new UpdateSchema to alter the columns of this table and commit the changes.
 
Result< std::shared_ptr< ExpireSnapshots > > NewExpireSnapshots ()
 Create a new ExpireSnapshots to remove expired snapshots and commit the changes.
 
Result< std::shared_ptr< UpdateStatistics > > NewUpdateStatistics ()
 Create a new UpdateStatistics to update table statistics and commit the changes.
 
Result< std::shared_ptr< UpdatePartitionStatistics > > NewUpdatePartitionStatistics ()
 Create a new UpdatePartitionStatistics to update partition statistics and commit the changes.
 
Result< std::shared_ptr< UpdateLocation > > NewUpdateLocation ()
 Create a new UpdateLocation to update the table location and commit the changes.
 
Result< std::shared_ptr< FastAppend > > NewFastAppend ()
 Create a new FastAppend to append data files and commit the changes.
 
Result< std::shared_ptr< SnapshotManager > > NewSnapshotManager ()
 Create a new SnapshotManager to manage snapshots.
 
Result< std::shared_ptr< SetSnapshot > > NewSetSnapshot ()
 Create a new SetSnapshot to set the current snapshot or rollback to a previous snapshot and commit the changes.
 
Result< std::shared_ptr< UpdateSnapshotReference > > NewUpdateSnapshotReference ()
 Create a new UpdateSnapshotReference to update snapshot references (branches and tags) and commit the changes.
 

Static Public Member Functions

static Result< std::shared_ptr< Transaction > > Make (std::shared_ptr< Table > table, TransactionKind kind)
 Create a new transaction.
 
static Result< std::shared_ptr< Transaction > > Make (std::shared_ptr< TransactionContext > ctx)
 Create a transaction from an existing context (used by PendingUpdate::Commit)
 

Friends

class PendingUpdate
 

Detailed Description

A transaction for performing multiple updates to a table.

Member Function Documentation

◆ Commit()

Result< std::shared_ptr< Table > > iceberg::Transaction::Commit ( )

Apply the pending changes from all actions and commit.

Returns
Updated table if the transaction was committed successfully, or an error:
  • ValidationFailed: if any update cannot be applied to the current table metadata.
  • CommitFailed: if the updates cannot be committed due to conflicts.

◆ MetadataFileLocation()

std::string iceberg::Transaction::MetadataFileLocation ( std::string_view  filename) const

Return the location of the metadata file with the given filename.

Parameters
filenamethe name of the metadata file
Returns
the location of the metadata file

The documentation for this class was generated from the following files: