Interface Table
-
- All Known Implementing Classes:
AllDataFilesTable
,AllDeleteFilesTable
,AllEntriesTable
,AllFilesTable
,AllManifestsTable
,BaseMetadataTable
,BaseTable
,BaseTransaction.TransactionTable
,DataFilesTable
,DeleteFilesTable
,FilesTable
,HistoryTable
,ManifestEntriesTable
,ManifestsTable
,MetadataLogEntriesTable
,PartitionsTable
,PositionDeletesTable
,RefsTable
,SerializableTable
,SerializableTable.SerializableMetadataTable
,SerializableTableWithSize
,SerializableTableWithSize.SerializableMetadataTableWithSize
,SnapshotsTable
public interface Table
Represents a table.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Snapshot
currentSnapshot()
Get the currentsnapshot
for this table, or null if there are no snapshots.EncryptionManager
encryption()
Returns anEncryptionManager
to encrypt and decrypt data files.ExpireSnapshots
expireSnapshots()
Create a newexpire API
to expire snapshots in this table and commit.java.util.List<HistoryEntry>
history()
Get the snapshot history of this table.FileIO
io()
Returns aFileIO
to read and write table data and metadata files.java.lang.String
location()
Return the table's base location.LocationProvider
locationProvider()
Returns aLocationProvider
to provide locations for new data files.ManageSnapshots
manageSnapshots()
Create a newmanage snapshots API
to manage snapshots in this table and commit.default java.lang.String
name()
Return the full name for this table.AppendFiles
newAppend()
Create a newappend API
to add files to this table and commit.default BatchScan
newBatchScan()
Create a newbatch scan
for this table.DeleteFiles
newDelete()
Create a newdelete API
to delete files in this table and commit.default AppendFiles
newFastAppend()
Create a newappend API
to add files to this table and commit.default IncrementalAppendScan
newIncrementalAppendScan()
Create a newscan
for this table.default IncrementalChangelogScan
newIncrementalChangelogScan()
Create a newIncrementalChangelogScan
for 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 and commit.RowDelta
newRowDelta()
Create a newrow-level delta API
to remove or replace rows in existing data files.TableScan
newScan()
Create a newscan
for this table.Transaction
newTransaction()
Create a newtransaction API
to commit multiple table operations at once.default java.util.List<PartitionStatisticsFile>
partitionStatisticsFiles()
Returns the current partition statistics files for the table.java.util.Map<java.lang.String,java.lang.String>
properties()
Return a map of string properties for this table.void
refresh()
Refresh the current table metadata.java.util.Map<java.lang.String,SnapshotRef>
refs()
Returns the current refs for the tableReplaceSortOrder
replaceSortOrder()
Create a newReplaceSortOrder
to set the table sort order and commit the change.RewriteManifests
rewriteManifests()
Create a newrewrite manifests API
to replace manifests for this table and commit.Schema
schema()
Return theschema
for this table.java.util.Map<java.lang.Integer,Schema>
schemas()
Return a map ofschema
for this table.Snapshot
snapshot(long snapshotId)
Get thesnapshot
of this table with the given id, or null if there is no matching snapshot.default Snapshot
snapshot(java.lang.String name)
Returns the snapshot referenced by the given name or null if no such reference exists.java.lang.Iterable<Snapshot>
snapshots()
Get thesnapshots
of this table.SortOrder
sortOrder()
Return thesort order
for this table.java.util.Map<java.lang.Integer,SortOrder>
sortOrders()
Return a map of sort order IDs tosort orders
for this table.PartitionSpec
spec()
Return thepartition spec
for this table.java.util.Map<java.lang.Integer,PartitionSpec>
specs()
Return a map ofpartition specs
for this table.java.util.List<StatisticsFile>
statisticsFiles()
Returns the current statistics files for the tableUpdateLocation
updateLocation()
Create a newUpdateLocation
to update table location and commit the changes.default UpdatePartitionStatistics
updatePartitionStatistics()
Create a newupdate partition statistics API
to add or remove partition statistics files in this table.UpdateProperties
updateProperties()
Create a newUpdateProperties
to update table properties and commit the changes.UpdateSchema
updateSchema()
Create a newUpdateSchema
to alter the columns of this table and commit the change.UpdatePartitionSpec
updateSpec()
Create a newUpdatePartitionSpec
to alter the partition spec of this table and commit the change.default UpdateStatistics
updateStatistics()
Create a newupdate table statistics API
to add or remove statistics files in this table.default java.util.UUID
uuid()
Returns the UUID of the table
-
-
-
Method Detail
-
name
default java.lang.String name()
Return the full name for this table.- Returns:
- this table's name
-
refresh
void refresh()
Refresh the current table metadata.
-
newScan
TableScan newScan()
Create a newscan
for this table.Once a table scan is created, it can be refined to project columns and filter data.
- Returns:
- a table scan for this table
-
newBatchScan
default BatchScan newBatchScan()
Create a newbatch scan
for this table.Once a batch scan is created, it can be refined to project columns and filter data.
- Returns:
- a batch scan for this table
-
newIncrementalAppendScan
default IncrementalAppendScan newIncrementalAppendScan()
Create a newscan
for this table.Once a scan is created, it can be refined to project columns and filter data.
- Returns:
- an incremental scan for appends only snapshots
-
newIncrementalChangelogScan
default IncrementalChangelogScan newIncrementalChangelogScan()
Create a newIncrementalChangelogScan
for this table.Once a scan is created, it can be refined to project columns and filter data.
- Returns:
- an incremental changelog scan
-
schemas
java.util.Map<java.lang.Integer,Schema> schemas()
Return a map ofschema
for this table.- Returns:
- this table's schema map
-
spec
PartitionSpec spec()
Return thepartition spec
for this table.- Returns:
- this table's partition spec
-
specs
java.util.Map<java.lang.Integer,PartitionSpec> specs()
Return a map ofpartition specs
for this table.- Returns:
- this table's partition specs map
-
sortOrder
SortOrder sortOrder()
Return thesort order
for this table.- Returns:
- this table's sort order
-
sortOrders
java.util.Map<java.lang.Integer,SortOrder> sortOrders()
Return a map of sort order IDs tosort orders
for this table.- Returns:
- this table's sort orders map
-
properties
java.util.Map<java.lang.String,java.lang.String> properties()
Return a map of string properties for this table.- Returns:
- this table's properties map
-
location
java.lang.String location()
Return the table's base location.- Returns:
- this table's location
-
currentSnapshot
Snapshot currentSnapshot()
Get the currentsnapshot
for this table, or null if there are no snapshots.- Returns:
- the current table Snapshot.
-
snapshot
Snapshot snapshot(long snapshotId)
Get thesnapshot
of this table with the given id, or null if there is no matching snapshot.- Returns:
- the
Snapshot
with the given id.
-
snapshots
java.lang.Iterable<Snapshot> snapshots()
Get thesnapshots
of this table.- Returns:
- an Iterable of snapshots of this table.
-
history
java.util.List<HistoryEntry> history()
Get the snapshot history of this table.- Returns:
- a list of
history entries
-
updateSchema
UpdateSchema updateSchema()
Create a newUpdateSchema
to alter the columns of this table and commit the change.- Returns:
- a new
UpdateSchema
-
updateSpec
UpdatePartitionSpec updateSpec()
Create a newUpdatePartitionSpec
to alter the partition spec of this table and commit the change.- Returns:
- a new
UpdatePartitionSpec
-
updateProperties
UpdateProperties updateProperties()
Create a newUpdateProperties
to update table properties and commit the changes.- Returns:
- a new
UpdateProperties
-
replaceSortOrder
ReplaceSortOrder replaceSortOrder()
Create a newReplaceSortOrder
to set the table sort order and commit the change.- Returns:
- a new
ReplaceSortOrder
-
updateLocation
UpdateLocation updateLocation()
Create a newUpdateLocation
to update table location and commit the changes.- Returns:
- a new
UpdateLocation
-
newAppend
AppendFiles newAppend()
Create a newappend API
to add files to this table and commit.- Returns:
- a new
AppendFiles
-
newFastAppend
default AppendFiles newFastAppend()
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
newAppend()
.- Returns:
- a new
AppendFiles
-
newRewrite
RewriteFiles newRewrite()
Create a newrewrite API
to replace files in this table and commit.- Returns:
- a new
RewriteFiles
-
rewriteManifests
RewriteManifests rewriteManifests()
Create a newrewrite manifests API
to replace manifests for this table and commit.- Returns:
- a new
RewriteManifests
-
newOverwrite
OverwriteFiles newOverwrite()
Create a newoverwrite API
to overwrite files by a filter expression.- Returns:
- a new
OverwriteFiles
-
newRowDelta
RowDelta newRowDelta()
Create a newrow-level delta API
to remove or replace rows in existing data files.- Returns:
- a new
RowDelta
-
newReplacePartitions
ReplacePartitions newReplacePartitions()
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.- Returns:
- a new
ReplacePartitions
-
newDelete
DeleteFiles newDelete()
Create a newdelete API
to delete files in this table and commit.- Returns:
- a new
DeleteFiles
-
updateStatistics
default UpdateStatistics updateStatistics()
Create a newupdate table statistics API
to add or remove statistics files in this table.- Returns:
- a new
UpdateStatistics
-
updatePartitionStatistics
default UpdatePartitionStatistics updatePartitionStatistics()
Create a newupdate partition statistics API
to add or remove partition statistics files in this table.- Returns:
- a new
UpdatePartitionStatistics
-
expireSnapshots
ExpireSnapshots expireSnapshots()
Create a newexpire API
to expire snapshots in this table and commit.- Returns:
- a new
ExpireSnapshots
-
manageSnapshots
ManageSnapshots manageSnapshots()
Create a newmanage snapshots API
to manage snapshots in this table and commit.- Returns:
- a new
ManageSnapshots
-
newTransaction
Transaction newTransaction()
Create a newtransaction API
to commit multiple table operations at once.- Returns:
- a new
Transaction
-
encryption
EncryptionManager encryption()
Returns anEncryptionManager
to encrypt and decrypt data files.
-
locationProvider
LocationProvider locationProvider()
Returns aLocationProvider
to provide locations for new data files.
-
statisticsFiles
java.util.List<StatisticsFile> statisticsFiles()
Returns the current statistics files for the table- Returns:
- the current statistics files for the table
-
partitionStatisticsFiles
default java.util.List<PartitionStatisticsFile> partitionStatisticsFiles()
Returns the current partition statistics files for the table.
-
refs
java.util.Map<java.lang.String,SnapshotRef> refs()
Returns the current refs for the table- Returns:
- the current refs for the table
-
uuid
default java.util.UUID uuid()
Returns the UUID of the table- Returns:
- the UUID of the table
-
snapshot
default Snapshot snapshot(java.lang.String name)
Returns the snapshot referenced by the given name or null if no such reference exists.- Returns:
- the snapshot which is referenced by the given name or null if no such reference exists.
-
-