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