Package org.apache.iceberg
Interface Transaction
- All Known Implementing Classes:
- BaseTransaction
public interface Transaction
A transaction for performing multiple updates to a table.
- 
Method SummaryModifier and TypeMethodDescriptionvoidApply the pending changes from all actions and commit.Create a newexpire APIto expire snapshots in this table.default ManageSnapshotsCreate a newmanage snapshot APIto manage snapshots in this table.Create a newappend APIto add files to this table.Create a newdelete APIto delete files in this table.default AppendFilesCreate a newappend APIto add files to this table.Create a newoverwrite APIto overwrite files by a filter expression.Not recommended: Create a newreplace partitions APIto dynamically overwrite partitions in the table with new data.Create a newrewrite APIto replace files in this table.Create a newrow-level delta APIto remove or replace rows in existing data files.Create a newReplaceSortOrderto set a table sort order.Create a newrewrite manifests APIto replace manifests for this table.table()Return theTablethat this transaction will update.Create a newUpdateLocationto update table location.default UpdatePartitionStatisticsCreate a newupdate partition statistics APIto add or remove partition statistics files in this table.Create a newUpdatePropertiesto update table properties.Create a newUpdateSchemato alter the columns of this table.Create a newUpdatePartitionSpecto alter the partition spec of this table.default UpdateStatisticsCreate a newupdate table statistics APIto add or remove statistics files in this table.
- 
Method Details- 
tableTable table()Return theTablethat this transaction will update.- Returns:
- this transaction's table
 
- 
updateSchemaUpdateSchema updateSchema()Create a newUpdateSchemato alter the columns of this table.- Returns:
- a new UpdateSchema
 
- 
updateSpecUpdatePartitionSpec updateSpec()Create a newUpdatePartitionSpecto alter the partition spec of this table.- Returns:
- a new UpdatePartitionSpec
 
- 
updatePropertiesUpdateProperties updateProperties()Create a newUpdatePropertiesto update table properties.- Returns:
- a new UpdateProperties
 
- 
replaceSortOrderReplaceSortOrder replaceSortOrder()Create a newReplaceSortOrderto set a table sort order.- Returns:
- a new ReplaceSortOrder
 
- 
updateLocationUpdateLocation updateLocation()Create a newUpdateLocationto update table location.- Returns:
- a new UpdateLocation
 
- 
newAppendAppendFiles newAppend()Create a newappend APIto add files to this table.- Returns:
- a new AppendFiles
 
- 
newFastAppendCreate a newappend APIto add files to this table.Using this method signals to the underlying implementation that the append should not perform extra work in order to commit quickly. Fast appends are not recommended for normal writes because the fast commit may cause split planning to slow down over time. Implementations may not support fast appends, in which case this will return the same appender as newAppend().- Returns:
- a new AppendFiles
 
- 
newRewriteRewriteFiles newRewrite()Create a newrewrite APIto replace files in this table.- Returns:
- a new RewriteFiles
 
- 
rewriteManifestsRewriteManifests rewriteManifests()Create a newrewrite manifests APIto replace manifests for this table.- Returns:
- a new RewriteManifests
 
- 
newOverwriteOverwriteFiles newOverwrite()Create a newoverwrite APIto overwrite files by a filter expression.- Returns:
- a new OverwriteFiles
 
- 
newRowDeltaRowDelta newRowDelta()Create a newrow-level delta APIto remove or replace rows in existing data files.- Returns:
- a new RowDelta
 
- 
newReplacePartitionsReplacePartitions newReplacePartitions()Not recommended: Create a newreplace partitions APIto dynamically overwrite partitions in the table with new data.This is provided to implement SQL compatible with Hive table operations but is not recommended. Instead, use the overwrite APIto explicitly overwrite data.- Returns:
- a new ReplacePartitions
 
- 
newDeleteDeleteFiles newDelete()Create a newdelete APIto delete files in this table.- Returns:
- a new DeleteFiles
 
- 
updateStatisticsCreate a newupdate table statistics APIto add or remove statistics files in this table.- Returns:
- a new UpdateStatistics
 
- 
updatePartitionStatisticsCreate a newupdate partition statistics APIto add or remove partition statistics files in this table.- Returns:
- a new UpdatePartitionStatistics
 
- 
expireSnapshotsExpireSnapshots expireSnapshots()Create a newexpire APIto expire snapshots in this table.- Returns:
- a new ExpireSnapshots
 
- 
manageSnapshotsCreate a newmanage snapshot APIto manage snapshots in this table.- Returns:
- a new ManageSnapshots
 
- 
commitTransactionvoid commitTransaction()Apply the pending changes from all actions and commit.- Throws:
- ValidationException- If any update cannot be applied to the current table metadata.
- CommitFailedException- If the updates cannot be committed due to conflicts.
 
 
-