Class BaseTable
- java.lang.Object
- 
- org.apache.iceberg.BaseTable
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- HasTableOperations,- Table
 
 public class BaseTable extends java.lang.Object implements Table, HasTableOperations, java.io.Serializable BaseTableimplementation.This can be extended by providing a TableOperationsto the constructor.Serializing and deserializing a BaseTable object returns a read only implementation of the BaseTable using a StaticTableOperations. This way no Catalog related calls are needed when reading the table data after deserialization.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description BaseTable(TableOperations ops, java.lang.String name)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description SnapshotcurrentSnapshot()Get the currentsnapshotfor this table, or null if there are no snapshots.EncryptionManagerencryption()Returns anEncryptionManagerto encrypt and decrypt data files.ExpireSnapshotsexpireSnapshots()Create a newexpire APIto manage snapshots in this table and commit.java.util.List<HistoryEntry>history()Get the snapshot history of this table.FileIOio()Returns aFileIOto read and write table data and metadata files.java.lang.Stringlocation()Return the table's base location.LocationProviderlocationProvider()Returns aLocationProviderto provide locations for new data files.ManageSnapshotsmanageSnapshots()Create a newmanage snapshots APIto manage snapshots in this table and commit.java.lang.Stringname()Return the full name for this table.AppendFilesnewAppend()Create a newappend APIto add files to this table and commit.DeleteFilesnewDelete()Create a newdelete APIto replace files in this table and commit.AppendFilesnewFastAppend()Create a newappend APIto add files to this table and commit.IncrementalAppendScannewIncrementalAppendScan()Create a newscanfor 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 and commit.RowDeltanewRowDelta()Create a newrow-level delta APIto remove or replace rows in existing data files.TableScannewScan()Create a newscanfor this table.TransactionnewTransaction()Create a newtransaction APIto commit multiple table operations at once.TableOperationsoperations()java.util.Map<java.lang.String,java.lang.String>properties()Return a map of string properties for this table.voidrefresh()Refresh the current table metadata.ReplaceSortOrderreplaceSortOrder()Create a newReplaceSortOrderto set the table sort order and commit the change.RewriteManifestsrewriteManifests()Create a newrewrite manifests APIto replace manifests for this table and commit.Rollbackrollback()Create a newrollback APIto roll back to a previous snapshot and commit.Schemaschema()Return theschemafor this table.java.util.Map<java.lang.Integer,Schema>schemas()Return a map ofschemafor this table.Snapshotsnapshot(long snapshotId)Get thesnapshotof this table with the given id, or null if there is no matching snapshot.java.lang.Iterable<Snapshot>snapshots()Get thesnapshotsof this table.SortOrdersortOrder()Return thesort orderfor this table.java.util.Map<java.lang.Integer,SortOrder>sortOrders()Return a map of sort order IDs tosort ordersfor this table.PartitionSpecspec()Return thepartition specfor this table.java.util.Map<java.lang.Integer,PartitionSpec>specs()Return a map ofpartition specsfor this table.java.lang.StringtoString()UpdateLocationupdateLocation()Create a newUpdateLocationto update table location and commit the changes.UpdatePropertiesupdateProperties()Create a newUpdatePropertiesto update table properties and commit the changes.UpdateSchemaupdateSchema()Create a newUpdateSchemato alter the columns of this table and commit the change.UpdatePartitionSpecupdateSpec()Create a newUpdatePartitionSpecto alter the partition spec of this table and commit the change.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.apache.iceberg.TablenewIncrementalChangelogScan
 
- 
 
- 
- 
- 
Constructor Detail- 
BaseTablepublic BaseTable(TableOperations ops, java.lang.String name) 
 
- 
 - 
Method Detail- 
operationspublic TableOperations operations() - Specified by:
- operationsin interface- HasTableOperations
 
 - 
namepublic java.lang.String name() Description copied from interface:TableReturn the full name for this table.
 - 
refreshpublic void refresh() Description copied from interface:TableRefresh the current table metadata.
 - 
newScanpublic TableScan newScan() Description copied from interface:TableCreate a newscanfor this table.Once a table scan is created, it can be refined to project columns and filter data. 
 - 
newIncrementalAppendScanpublic IncrementalAppendScan newIncrementalAppendScan() Description copied from interface:TableCreate a newscanfor this table.Once a scan is created, it can be refined to project columns and filter data. - Specified by:
- newIncrementalAppendScanin interface- Table
- Returns:
- an incremental scan for appends only snapshots
 
 - 
schemapublic Schema schema() Description copied from interface:TableReturn theschemafor this table.
 - 
schemaspublic java.util.Map<java.lang.Integer,Schema> schemas() Description copied from interface:TableReturn a map ofschemafor this table.
 - 
specpublic PartitionSpec spec() Description copied from interface:TableReturn thepartition specfor this table.
 - 
specspublic java.util.Map<java.lang.Integer,PartitionSpec> specs() Description copied from interface:TableReturn a map ofpartition specsfor this table.
 - 
sortOrderpublic SortOrder sortOrder() Description copied from interface:TableReturn thesort orderfor this table.
 - 
sortOrderspublic java.util.Map<java.lang.Integer,SortOrder> sortOrders() Description copied from interface:TableReturn a map of sort order IDs tosort ordersfor this table.- Specified by:
- sortOrdersin interface- Table
- Returns:
- this table's sort orders map
 
 - 
propertiespublic java.util.Map<java.lang.String,java.lang.String> properties() Description copied from interface:TableReturn a map of string properties for this table.- Specified by:
- propertiesin interface- Table
- Returns:
- this table's properties map
 
 - 
locationpublic java.lang.String location() Description copied from interface:TableReturn the table's base location.
 - 
currentSnapshotpublic Snapshot currentSnapshot() Description copied from interface:TableGet the currentsnapshotfor this table, or null if there are no snapshots.- Specified by:
- currentSnapshotin interface- Table
- Returns:
- the current table Snapshot.
 
 - 
snapshotpublic Snapshot snapshot(long snapshotId) Description copied from interface:TableGet thesnapshotof this table with the given id, or null if there is no matching snapshot.
 - 
snapshotspublic java.lang.Iterable<Snapshot> snapshots() Description copied from interface:TableGet thesnapshotsof this table.
 - 
historypublic java.util.List<HistoryEntry> history() Description copied from interface:TableGet the snapshot history of this table.- Specified by:
- historyin interface- Table
- Returns:
- a list of history entries
 
 - 
updateSchemapublic UpdateSchema updateSchema() Description copied from interface:TableCreate a newUpdateSchemato alter the columns of this table and commit the change.- Specified by:
- updateSchemain interface- Table
- Returns:
- a new UpdateSchema
 
 - 
updateSpecpublic UpdatePartitionSpec updateSpec() Description copied from interface:TableCreate a newUpdatePartitionSpecto alter the partition spec of this table and commit the change.- Specified by:
- updateSpecin interface- Table
- Returns:
- a new UpdatePartitionSpec
 
 - 
updatePropertiespublic UpdateProperties updateProperties() Description copied from interface:TableCreate a newUpdatePropertiesto update table properties and commit the changes.- Specified by:
- updatePropertiesin interface- Table
- Returns:
- a new UpdateProperties
 
 - 
replaceSortOrderpublic ReplaceSortOrder replaceSortOrder() Description copied from interface:TableCreate a newReplaceSortOrderto set the table sort order and commit the change.- Specified by:
- replaceSortOrderin interface- Table
- Returns:
- a new ReplaceSortOrder
 
 - 
updateLocationpublic UpdateLocation updateLocation() Description copied from interface:TableCreate a newUpdateLocationto update table location and commit the changes.- Specified by:
- updateLocationin interface- Table
- Returns:
- a new UpdateLocation
 
 - 
newAppendpublic AppendFiles newAppend() Description copied from interface:TableCreate a newappend APIto add files to this table and commit.- Specified by:
- newAppendin interface- Table
- Returns:
- a new AppendFiles
 
 - 
newFastAppendpublic AppendFiles newFastAppend() Description copied from interface:TableCreate a newappend APIto add files to this table and commit.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 Table.newAppend().- Specified by:
- newFastAppendin interface- Table
- Returns:
- a new AppendFiles
 
 - 
newRewritepublic RewriteFiles newRewrite() Description copied from interface:TableCreate a newrewrite APIto replace files in this table and commit.- Specified by:
- newRewritein interface- Table
- Returns:
- a new RewriteFiles
 
 - 
rewriteManifestspublic RewriteManifests rewriteManifests() Description copied from interface:TableCreate a newrewrite manifests APIto replace manifests for this table and commit.- Specified by:
- rewriteManifestsin interface- Table
- Returns:
- a new RewriteManifests
 
 - 
newOverwritepublic OverwriteFiles newOverwrite() Description copied from interface:TableCreate a newoverwrite APIto overwrite files by a filter expression.- Specified by:
- newOverwritein interface- Table
- Returns:
- a new OverwriteFiles
 
 - 
newRowDeltapublic RowDelta newRowDelta() Description copied from interface:TableCreate a newrow-level delta APIto remove or replace rows in existing data files.- Specified by:
- newRowDeltain interface- Table
- Returns:
- a new RowDelta
 
 - 
newReplacePartitionspublic ReplacePartitions newReplacePartitions() Description copied from interface:TableNot 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 interface- Table
- Returns:
- a new ReplacePartitions
 
 - 
newDeletepublic DeleteFiles newDelete() Description copied from interface:TableCreate a newdelete APIto replace files in this table and commit.- Specified by:
- newDeletein interface- Table
- Returns:
- a new DeleteFiles
 
 - 
expireSnapshotspublic ExpireSnapshots expireSnapshots() Description copied from interface:TableCreate a newexpire APIto manage snapshots in this table and commit.- Specified by:
- expireSnapshotsin interface- Table
- Returns:
- a new ExpireSnapshots
 
 - 
rollbackpublic Rollback rollback() Description copied from interface:TableCreate a newrollback APIto roll back to a previous snapshot and commit.
 - 
manageSnapshotspublic ManageSnapshots manageSnapshots() Description copied from interface:TableCreate a newmanage snapshots APIto manage snapshots in this table and commit.- Specified by:
- manageSnapshotsin interface- Table
- Returns:
- a new ManageSnapshots
 
 - 
newTransactionpublic Transaction newTransaction() Description copied from interface:TableCreate a newtransaction APIto commit multiple table operations at once.- Specified by:
- newTransactionin interface- Table
- Returns:
- a new Transaction
 
 - 
iopublic FileIO io() Description copied from interface:TableReturns aFileIOto read and write table data and metadata files.
 - 
encryptionpublic EncryptionManager encryption() Description copied from interface:TableReturns anEncryptionManagerto encrypt and decrypt data files.- Specified by:
- encryptionin interface- Table
 
 - 
locationProviderpublic LocationProvider locationProvider() Description copied from interface:TableReturns aLocationProviderto provide locations for new data files.- Specified by:
- locationProviderin interface- Table
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-