Class BaseTable
- All Implemented Interfaces:
Serializable
,HasTableOperations
,Table
Table
implementation.
This can be extended by providing a TableOperations
to 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:
-
Constructor Summary
ConstructorDescriptionBaseTable
(TableOperations ops, String name) BaseTable
(TableOperations ops, String name, MetricsReporter reporter) -
Method Summary
Modifier and TypeMethodDescriptionGet the currentsnapshot
for this table, or null if there are no snapshots.Returns anEncryptionManager
to encrypt and decrypt data files.Create a newexpire API
to manage snapshots in this table and commit.history()
Get the snapshot history of this table.io()
Returns aFileIO
to read and write table data and metadata files.location()
Return the table's base location.Returns aLocationProvider
to provide locations for new data files.Create a newmanage snapshots API
to manage snapshots in this table and commit.name()
Return the full name for this table.Create a newappend API
to add files to this table and commit.Create a newdelete API
to replace files in this table and commit.Create a newappend API
to add files to this table and commit.Create a newscan
for this table.Create a newIncrementalChangelogScan
for this table.Create a newoverwrite API
to overwrite files by a filter expression.Not recommended: Create a newreplace partitions API
to dynamically overwrite partitions in the table with new data.Create a newrewrite API
to replace files in this table and commit.Create a newrow-level delta API
to remove or replace rows in existing data files.newScan()
Create a newscan
for this table.Create a newtransaction API
to commit multiple table operations at once.Returns the current partition statistics files for the table.Return a map of string properties for this table.void
refresh()
Refresh the current table metadata.refs()
Returns the current refs for the tableCreate a newReplaceSortOrder
to set the table sort order and commit the change.Create a newrewrite manifests API
to replace manifests for this table and commit.schema()
Return theschema
for this table.schemas()
Return a map ofschema
for this table.snapshot
(long snapshotId) Get thesnapshot
of this table with the given id, or null if there is no matching snapshot.Get thesnapshots
of this table.Return thesort order
for this table.Return a map of sort order IDs tosort orders
for this table.spec()
Return thepartition spec
for this table.specs()
Return a map ofpartition specs
for this table.Returns the current statistics files for the tabletoString()
Create a newUpdateLocation
to update table location and commit the changes.Create a newupdate partition statistics API
to add or remove partition statistics files in this table.Create a newUpdateProperties
to update table properties and commit the changes.Create a newUpdateSchema
to alter the columns of this table and commit the change.Create a newUpdatePartitionSpec
to alter the partition spec of this table and commit the change.Create a newupdate table statistics API
to add or remove statistics files in this table.uuid()
Returns the UUID of the tableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.iceberg.Table
newBatchScan, snapshot
-
Constructor Details
-
BaseTable
-
BaseTable
-
-
Method Details
-
operations
- Specified by:
operations
in interfaceHasTableOperations
-
name
Description copied from interface:Table
Return the full name for this table. -
refresh
public void refresh()Description copied from interface:Table
Refresh the current table metadata. -
newScan
Description copied from interface:Table
Create a newscan
for this table.Once a table scan is created, it can be refined to project columns and filter data.
-
newIncrementalAppendScan
Description copied from interface:Table
Create a newscan
for this table.Once a scan is created, it can be refined to project columns and filter data.
- Specified by:
newIncrementalAppendScan
in interfaceTable
- Returns:
- an incremental scan for appends only snapshots
-
newIncrementalChangelogScan
Description copied from interface:Table
Create a newIncrementalChangelogScan
for this table.Once a scan is created, it can be refined to project columns and filter data.
- Specified by:
newIncrementalChangelogScan
in interfaceTable
- Returns:
- an incremental changelog scan
-
schema
Description copied from interface:Table
Return theschema
for this table. -
schemas
Description copied from interface:Table
Return a map ofschema
for this table. -
spec
Description copied from interface:Table
Return thepartition spec
for this table. -
specs
Description copied from interface:Table
Return a map ofpartition specs
for this table. -
sortOrder
Description copied from interface:Table
Return thesort order
for this table. -
sortOrders
Description copied from interface:Table
Return a map of sort order IDs tosort orders
for this table.- Specified by:
sortOrders
in interfaceTable
- Returns:
- this table's sort orders map
-
properties
Description copied from interface:Table
Return a map of string properties for this table.- Specified by:
properties
in interfaceTable
- Returns:
- this table's properties map
-
location
Description copied from interface:Table
Return the table's base location. -
currentSnapshot
Description copied from interface:Table
Get the currentsnapshot
for this table, or null if there are no snapshots.- Specified by:
currentSnapshot
in interfaceTable
- Returns:
- the current table Snapshot.
-
snapshot
Description copied from interface:Table
Get thesnapshot
of this table with the given id, or null if there is no matching snapshot. -
snapshots
Description copied from interface:Table
Get thesnapshots
of this table. -
history
Description copied from interface:Table
Get the snapshot history of this table.- Specified by:
history
in interfaceTable
- Returns:
- a list of
history entries
-
updateSchema
Description copied from interface:Table
Create a newUpdateSchema
to alter the columns of this table and commit the change.- Specified by:
updateSchema
in interfaceTable
- Returns:
- a new
UpdateSchema
-
updateSpec
Description copied from interface:Table
Create a newUpdatePartitionSpec
to alter the partition spec of this table and commit the change.- Specified by:
updateSpec
in interfaceTable
- Returns:
- a new
UpdatePartitionSpec
-
updateProperties
Description copied from interface:Table
Create a newUpdateProperties
to update table properties and commit the changes.- Specified by:
updateProperties
in interfaceTable
- Returns:
- a new
UpdateProperties
-
replaceSortOrder
Description copied from interface:Table
Create a newReplaceSortOrder
to set the table sort order and commit the change.- Specified by:
replaceSortOrder
in interfaceTable
- Returns:
- a new
ReplaceSortOrder
-
updateLocation
Description copied from interface:Table
Create a newUpdateLocation
to update table location and commit the changes.- Specified by:
updateLocation
in interfaceTable
- Returns:
- a new
UpdateLocation
-
newAppend
Description copied from interface:Table
Create a newappend API
to add files to this table and commit.- Specified by:
newAppend
in interfaceTable
- Returns:
- a new
AppendFiles
-
newFastAppend
Description copied from interface:Table
Create a newappend API
to 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:
newFastAppend
in interfaceTable
- Returns:
- a new
AppendFiles
-
newRewrite
Description copied from interface:Table
Create a newrewrite API
to replace files in this table and commit.- Specified by:
newRewrite
in interfaceTable
- Returns:
- a new
RewriteFiles
-
rewriteManifests
Description copied from interface:Table
Create a newrewrite manifests API
to replace manifests for this table and commit.- Specified by:
rewriteManifests
in interfaceTable
- Returns:
- a new
RewriteManifests
-
newOverwrite
Description copied from interface:Table
Create a newoverwrite API
to overwrite files by a filter expression.- Specified by:
newOverwrite
in interfaceTable
- Returns:
- a new
OverwriteFiles
-
newRowDelta
Description copied from interface:Table
Create a newrow-level delta API
to remove or replace rows in existing data files.- Specified by:
newRowDelta
in interfaceTable
- Returns:
- a new
RowDelta
-
newReplacePartitions
Description copied from interface:Table
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 interfaceTable
- Returns:
- a new
ReplacePartitions
-
newDelete
Description copied from interface:Table
Create a newdelete API
to replace files in this table and commit.- Specified by:
newDelete
in interfaceTable
- Returns:
- a new
DeleteFiles
-
updateStatistics
Description copied from interface:Table
Create a newupdate table statistics API
to add or remove statistics files in this table.- Specified by:
updateStatistics
in interfaceTable
- Returns:
- a new
UpdateStatistics
-
updatePartitionStatistics
Description copied from interface:Table
Create a newupdate partition statistics API
to add or remove partition statistics files in this table.- Specified by:
updatePartitionStatistics
in interfaceTable
- Returns:
- a new
UpdatePartitionStatistics
-
expireSnapshots
Description copied from interface:Table
Create a newexpire API
to manage snapshots in this table and commit.- Specified by:
expireSnapshots
in interfaceTable
- Returns:
- a new
ExpireSnapshots
-
manageSnapshots
Description copied from interface:Table
Create a newmanage snapshots API
to manage snapshots in this table and commit.- Specified by:
manageSnapshots
in interfaceTable
- Returns:
- a new
ManageSnapshots
-
newTransaction
Description copied from interface:Table
Create a newtransaction API
to commit multiple table operations at once.- Specified by:
newTransaction
in interfaceTable
- Returns:
- a new
Transaction
-
io
Description copied from interface:Table
Returns aFileIO
to read and write table data and metadata files. -
encryption
Description copied from interface:Table
Returns anEncryptionManager
to encrypt and decrypt data files.- Specified by:
encryption
in interfaceTable
-
locationProvider
Description copied from interface:Table
Returns aLocationProvider
to provide locations for new data files.- Specified by:
locationProvider
in interfaceTable
-
statisticsFiles
Description copied from interface:Table
Returns the current statistics files for the table- Specified by:
statisticsFiles
in interfaceTable
- Returns:
- the current statistics files for the table
-
partitionStatisticsFiles
Description copied from interface:Table
Returns the current partition statistics files for the table.- Specified by:
partitionStatisticsFiles
in interfaceTable
-
refs
Description copied from interface:Table
Returns the current refs for the table -
uuid
Description copied from interface:Table
Returns the UUID of the table -
toString
-