Package org.apache.iceberg
Interface Transaction
- All Known Implementing Classes:
BaseTransaction
public interface Transaction
A transaction for performing multiple updates to a table.
-
Method Summary
Modifier and TypeMethodDescriptionvoidApply the pending changes from all actions and commit.Create a newexpire APIto manage 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 replace 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 and commit the change.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
-
table
Table table()Return theTablethat this transaction will update.- Returns:
- this transaction's table
-
updateSchema
UpdateSchema updateSchema()Create a newUpdateSchemato alter the columns of this table.- Returns:
- a new
UpdateSchema
-
updateSpec
UpdatePartitionSpec updateSpec()Create a newUpdatePartitionSpecto alter the partition spec of this table.- Returns:
- a new
UpdatePartitionSpec
-
updateProperties
UpdateProperties updateProperties()Create a newUpdatePropertiesto update table properties.- Returns:
- a new
UpdateProperties
-
replaceSortOrder
ReplaceSortOrder replaceSortOrder()Create a newReplaceSortOrderto set a table sort order and commit the change.- Returns:
- a new
ReplaceSortOrder
-
updateLocation
UpdateLocation updateLocation()Create a newUpdateLocationto update table location.- Returns:
- a new
UpdateLocation
-
newAppend
AppendFiles newAppend()Create a newappend APIto add files to this table.- Returns:
- a new
AppendFiles
-
newFastAppend
Create 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
-
newRewrite
RewriteFiles newRewrite()Create a newrewrite APIto replace files in this table.- Returns:
- a new
RewriteFiles
-
rewriteManifests
RewriteManifests rewriteManifests()Create a newrewrite manifests APIto replace manifests for this table.- Returns:
- a new
RewriteManifests
-
newOverwrite
OverwriteFiles newOverwrite()Create a newoverwrite APIto overwrite files by a filter expression.- Returns:
- a new
OverwriteFiles
-
newRowDelta
RowDelta newRowDelta()Create a newrow-level delta APIto remove or replace rows in existing data files.- Returns:
- a new
RowDelta
-
newReplacePartitions
ReplacePartitions 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
-
newDelete
DeleteFiles newDelete()Create a newdelete APIto replace files in this table.- Returns:
- a new
DeleteFiles
-
updateStatistics
Create a newupdate table statistics APIto add or remove statistics files in this table.- Returns:
- a new
UpdateStatistics
-
updatePartitionStatistics
Create a newupdate partition statistics APIto add or remove partition statistics files in this table.- Returns:
- a new
UpdatePartitionStatistics
-
expireSnapshots
ExpireSnapshots expireSnapshots()Create a newexpire APIto manage snapshots in this table.- Returns:
- a new
ExpireSnapshots
-
manageSnapshots
Create a newmanage snapshot APIto manage snapshots in this table.- Returns:
- a new
ManageSnapshots
-
commitTransaction
void 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.
-