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 class
BaseTransaction.TransactionTable
class
BaseTransaction.TransactionTableOperations
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commitTransaction()
Apply the pending changes from all actions and commit.ExpireSnapshots
expireSnapshots()
Create a newexpire API
to manage snapshots in this table.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 replace files in this table.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 and commit the change.RewriteManifests
rewriteManifests()
Create a newrewrite manifests API
to replace manifests for this table.TableMetadata
startMetadata()
Table
table()
Return theTable
that this transaction will update.java.lang.String
tableName()
TableOperations
underlyingOps()
UpdateLocation
updateLocation()
Create a newUpdateLocation
to update table location.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.UpdateStatistics
updateStatistics()
Create a newupdate table statistics API
to add or remove statistics files in this table.
-
-
-
Method Detail
-
table
public Table table()
Description copied from interface:Transaction
Return theTable
that this transaction will update.- Specified by:
table
in interfaceTransaction
- Returns:
- this transaction's table
-
tableName
public java.lang.String tableName()
-
startMetadata
public TableMetadata startMetadata()
-
underlyingOps
public TableOperations underlyingOps()
-
updateSchema
public UpdateSchema updateSchema()
Description copied from interface:Transaction
Create a newUpdateSchema
to alter the columns of this table.- Specified by:
updateSchema
in interfaceTransaction
- Returns:
- a new
UpdateSchema
-
updateSpec
public UpdatePartitionSpec updateSpec()
Description copied from interface:Transaction
Create a newUpdatePartitionSpec
to alter the partition spec of this table.- Specified by:
updateSpec
in interfaceTransaction
- Returns:
- a new
UpdatePartitionSpec
-
updateProperties
public UpdateProperties updateProperties()
Description copied from interface:Transaction
Create a newUpdateProperties
to update table properties.- Specified by:
updateProperties
in interfaceTransaction
- Returns:
- a new
UpdateProperties
-
replaceSortOrder
public ReplaceSortOrder replaceSortOrder()
Description copied from interface:Transaction
Create a newReplaceSortOrder
to set a table sort order and commit the change.- Specified by:
replaceSortOrder
in interfaceTransaction
- Returns:
- a new
ReplaceSortOrder
-
updateLocation
public UpdateLocation updateLocation()
Description copied from interface:Transaction
Create a newUpdateLocation
to update table location.- Specified by:
updateLocation
in interfaceTransaction
- Returns:
- a new
UpdateLocation
-
newAppend
public AppendFiles newAppend()
Description copied from interface:Transaction
Create a newappend API
to add files to this table.- Specified by:
newAppend
in interfaceTransaction
- Returns:
- a new
AppendFiles
-
newFastAppend
public AppendFiles newFastAppend()
Description copied from interface:Transaction
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
Transaction.newAppend()
.- Specified by:
newFastAppend
in interfaceTransaction
- Returns:
- a new
AppendFiles
-
newRewrite
public RewriteFiles newRewrite()
Description copied from interface:Transaction
Create a newrewrite API
to replace files in this table.- Specified by:
newRewrite
in interfaceTransaction
- Returns:
- a new
RewriteFiles
-
rewriteManifests
public RewriteManifests rewriteManifests()
Description copied from interface:Transaction
Create a newrewrite manifests API
to replace manifests for this table.- Specified by:
rewriteManifests
in interfaceTransaction
- Returns:
- a new
RewriteManifests
-
newOverwrite
public OverwriteFiles newOverwrite()
Description copied from interface:Transaction
Create a newoverwrite API
to overwrite files by a filter expression.- Specified by:
newOverwrite
in interfaceTransaction
- Returns:
- a new
OverwriteFiles
-
newRowDelta
public RowDelta newRowDelta()
Description copied from interface:Transaction
Create a newrow-level delta API
to remove or replace rows in existing data files.- Specified by:
newRowDelta
in interfaceTransaction
- Returns:
- a new
RowDelta
-
newReplacePartitions
public ReplacePartitions newReplacePartitions()
Description copied from interface:Transaction
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.- Specified by:
newReplacePartitions
in interfaceTransaction
- Returns:
- a new
ReplacePartitions
-
newDelete
public DeleteFiles newDelete()
Description copied from interface:Transaction
Create a newdelete API
to replace files in this table.- Specified by:
newDelete
in interfaceTransaction
- Returns:
- a new
DeleteFiles
-
updateStatistics
public UpdateStatistics updateStatistics()
Description copied from interface:Transaction
Create a newupdate table statistics API
to add or remove statistics files in this table.- Specified by:
updateStatistics
in interfaceTransaction
- Returns:
- a new
UpdateStatistics
-
expireSnapshots
public ExpireSnapshots expireSnapshots()
Description copied from interface:Transaction
Create a newexpire API
to manage snapshots in this table.- Specified by:
expireSnapshots
in interfaceTransaction
- Returns:
- a new
ExpireSnapshots
-
manageSnapshots
public ManageSnapshots manageSnapshots()
Description copied from interface:Transaction
Create a newmanage snapshot API
to manage snapshots in this table.- Specified by:
manageSnapshots
in interfaceTransaction
- Returns:
- a new
ManageSnapshots
-
commitTransaction
public void commitTransaction()
Description copied from interface:Transaction
Apply the pending changes from all actions and commit.- Specified by:
commitTransaction
in interfaceTransaction
-
-