Package org.apache.iceberg
Interface Transaction
-
public interface TransactionA transaction for performing multiple updates to a table.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcommitTransaction()Apply the pending changes from all actions and commit.ExpireSnapshotsexpireSnapshots()Create a newexpire APIto manage snapshots in this table.AppendFilesnewAppend()Create a newappend APIto add files to this table.DeleteFilesnewDelete()Create a newdelete APIto replace files in this table.default AppendFilesnewFastAppend()Create a newappend APIto add files to this table.OverwriteFilesnewOverwrite()Create a newoverwrite APIto overwrite files by a filter expression.ReplacePartitionsnewReplacePartitions()Not recommended: Create a newreplace partitions APIto dynamically overwrite partitions in the table with new data.RewriteFilesnewRewrite()Create a newrewrite APIto replace files in this table.RowDeltanewRowDelta()Create a newrow-level delta APIto remove or replace rows in existing data files.ReplaceSortOrderreplaceSortOrder()Create a newReplaceSortOrderto set a table sort order and commit the change.RewriteManifestsrewriteManifests()Create a newrewrite manifests APIto replace manifests for this table.Tabletable()Return theTablethat this transaction will update.UpdateLocationupdateLocation()Create a newUpdateLocationto update table location.UpdatePropertiesupdateProperties()Create a newUpdatePropertiesto update table properties.UpdateSchemaupdateSchema()Create a newUpdateSchemato alter the columns of this table.UpdatePartitionSpecupdateSpec()Create a newUpdatePartitionSpecto alter the partition spec of this table.
-
-
-
Method Detail
-
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
default 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
-
expireSnapshots
ExpireSnapshots expireSnapshots()
Create a newexpire APIto manage snapshots in this table.- Returns:
- a new
ExpireSnapshots
-
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.
-
-