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 TypeMethodDescriptionvoid
Apply the pending changes from all actions and commit.Create a newexpire API
to manage snapshots in this table.default ManageSnapshots
Create a newmanage snapshot API
to manage snapshots in this table.Create a newappend API
to add files to this table.Create a newdelete API
to replace files in this table.default AppendFiles
Create a newappend API
to add files to this table.Create a newoverwrite API
to overwrite files by a filter expression.Not recommended: Create a newreplace partitions API
to dynamically overwrite partitions in the table with new data.Create a newrewrite API
to replace files in this table.Create a newrow-level delta API
to remove or replace rows in existing data files.Create a newReplaceSortOrder
to set a table sort order and commit the change.Create a newrewrite manifests API
to replace manifests for this table.table()
Return theTable
that this transaction will update.Create a newUpdateLocation
to update table location.default UpdatePartitionStatistics
Create a newupdate partition statistics API
to add or remove partition statistics files in this table.Create a newUpdateProperties
to update table properties.Create a newUpdateSchema
to alter the columns of this table.Create a newUpdatePartitionSpec
to alter the partition spec of this table.default UpdateStatistics
Create a newupdate table statistics API
to add or remove statistics files in this table.
-
Method Details
-
table
Table table()Return theTable
that this transaction will update.- Returns:
- this transaction's table
-
updateSchema
UpdateSchema updateSchema()Create a newUpdateSchema
to alter the columns of this table.- Returns:
- a new
UpdateSchema
-
updateSpec
UpdatePartitionSpec updateSpec()Create a newUpdatePartitionSpec
to alter the partition spec of this table.- Returns:
- a new
UpdatePartitionSpec
-
updateProperties
UpdateProperties updateProperties()Create a newUpdateProperties
to update table properties.- Returns:
- a new
UpdateProperties
-
replaceSortOrder
ReplaceSortOrder replaceSortOrder()Create a newReplaceSortOrder
to set a table sort order and commit the change.- Returns:
- a new
ReplaceSortOrder
-
updateLocation
UpdateLocation updateLocation()Create a newUpdateLocation
to update table location.- Returns:
- a new
UpdateLocation
-
newAppend
AppendFiles newAppend()Create a newappend API
to add files to this table.- Returns:
- a new
AppendFiles
-
newFastAppend
Create a newappend API
to 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 API
to replace files in this table.- Returns:
- a new
RewriteFiles
-
rewriteManifests
RewriteManifests rewriteManifests()Create a newrewrite manifests API
to replace manifests for this table.- Returns:
- a new
RewriteManifests
-
newOverwrite
OverwriteFiles newOverwrite()Create a newoverwrite API
to overwrite files by a filter expression.- Returns:
- a new
OverwriteFiles
-
newRowDelta
RowDelta newRowDelta()Create a newrow-level delta API
to remove or replace rows in existing data files.- Returns:
- a new
RowDelta
-
newReplacePartitions
ReplacePartitions newReplacePartitions()Not recommended: Create a newreplace partitions API
to 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 API
to explicitly overwrite data.- Returns:
- a new
ReplacePartitions
-
newDelete
DeleteFiles newDelete()Create a newdelete API
to replace files in this table.- Returns:
- a new
DeleteFiles
-
updateStatistics
Create a newupdate table statistics API
to add or remove statistics files in this table.- Returns:
- a new
UpdateStatistics
-
updatePartitionStatistics
Create a newupdate partition statistics API
to add or remove partition statistics files in this table.- Returns:
- a new
UpdatePartitionStatistics
-
expireSnapshots
ExpireSnapshots expireSnapshots()Create a newexpire API
to manage snapshots in this table.- Returns:
- a new
ExpireSnapshots
-
manageSnapshots
Create a newmanage snapshot API
to 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.
-