Package org.apache.iceberg
Class BaseTransaction
- java.lang.Object
-
- org.apache.iceberg.BaseTransaction
-
- All Implemented Interfaces:
Transaction
public class BaseTransaction extends java.lang.Object implements Transaction
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classBaseTransaction.TransactionTableclassBaseTransaction.TransactionTableOperations
-
Method Summary
All Methods Instance Methods Concrete 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.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.TableMetadatastartMetadata()Tabletable()Return theTablethat this transaction will update.TableOperationsunderlyingOps()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
public Table table()
Description copied from interface:TransactionReturn theTablethat this transaction will update.- Specified by:
tablein interfaceTransaction- Returns:
- this transaction's table
-
startMetadata
public TableMetadata startMetadata()
-
underlyingOps
public TableOperations underlyingOps()
-
updateSchema
public UpdateSchema updateSchema()
Description copied from interface:TransactionCreate a newUpdateSchemato alter the columns of this table.- Specified by:
updateSchemain interfaceTransaction- Returns:
- a new
UpdateSchema
-
updateSpec
public UpdatePartitionSpec updateSpec()
Description copied from interface:TransactionCreate a newUpdatePartitionSpecto alter the partition spec of this table.- Specified by:
updateSpecin interfaceTransaction- Returns:
- a new
UpdatePartitionSpec
-
updateProperties
public UpdateProperties updateProperties()
Description copied from interface:TransactionCreate a newUpdatePropertiesto update table properties.- Specified by:
updatePropertiesin interfaceTransaction- Returns:
- a new
UpdateProperties
-
replaceSortOrder
public ReplaceSortOrder replaceSortOrder()
Description copied from interface:TransactionCreate a newReplaceSortOrderto set a table sort order and commit the change.- Specified by:
replaceSortOrderin interfaceTransaction- Returns:
- a new
ReplaceSortOrder
-
updateLocation
public UpdateLocation updateLocation()
Description copied from interface:TransactionCreate a newUpdateLocationto update table location.- Specified by:
updateLocationin interfaceTransaction- Returns:
- a new
UpdateLocation
-
newAppend
public AppendFiles newAppend()
Description copied from interface:TransactionCreate a newappend APIto add files to this table.- Specified by:
newAppendin interfaceTransaction- Returns:
- a new
AppendFiles
-
newFastAppend
public AppendFiles newFastAppend()
Description copied from interface:TransactionCreate 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
Transaction.newAppend().- Specified by:
newFastAppendin interfaceTransaction- Returns:
- a new
AppendFiles
-
newRewrite
public RewriteFiles newRewrite()
Description copied from interface:TransactionCreate a newrewrite APIto replace files in this table.- Specified by:
newRewritein interfaceTransaction- Returns:
- a new
RewriteFiles
-
rewriteManifests
public RewriteManifests rewriteManifests()
Description copied from interface:TransactionCreate a newrewrite manifests APIto replace manifests for this table.- Specified by:
rewriteManifestsin interfaceTransaction- Returns:
- a new
RewriteManifests
-
newOverwrite
public OverwriteFiles newOverwrite()
Description copied from interface:TransactionCreate a newoverwrite APIto overwrite files by a filter expression.- Specified by:
newOverwritein interfaceTransaction- Returns:
- a new
OverwriteFiles
-
newRowDelta
public RowDelta newRowDelta()
Description copied from interface:TransactionCreate a newrow-level delta APIto remove or replace rows in existing data files.- Specified by:
newRowDeltain interfaceTransaction- Returns:
- a new
RowDelta
-
newReplacePartitions
public ReplacePartitions newReplacePartitions()
Description copied from interface:TransactionNot 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.- Specified by:
newReplacePartitionsin interfaceTransaction- Returns:
- a new
ReplacePartitions
-
newDelete
public DeleteFiles newDelete()
Description copied from interface:TransactionCreate a newdelete APIto replace files in this table.- Specified by:
newDeletein interfaceTransaction- Returns:
- a new
DeleteFiles
-
expireSnapshots
public ExpireSnapshots expireSnapshots()
Description copied from interface:TransactionCreate a newexpire APIto manage snapshots in this table.- Specified by:
expireSnapshotsin interfaceTransaction- Returns:
- a new
ExpireSnapshots
-
commitTransaction
public void commitTransaction()
Description copied from interface:TransactionApply the pending changes from all actions and commit.- Specified by:
commitTransactionin interfaceTransaction
-
-