public abstract class BaseMetadataTable
extends java.lang.Object
implements java.io.Serializable
Serializing and deserializing a metadata table object returns a read only implementation of
the metadata table using a StaticTableOperations. This way no Catalog related calls are
needed when reading the table data after deserialization.
| Modifier | Constructor and Description |
|---|---|
protected |
BaseMetadataTable(Table table,
java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
Snapshot |
currentSnapshot()
Get the current
snapshot for this table, or null if there are no snapshots. |
EncryptionManager |
encryption()
Returns an
EncryptionManager to encrypt and decrypt data
files. |
ExpireSnapshots |
expireSnapshots()
Create a new
expire API to manage snapshots in this table and commit. |
java.util.List<HistoryEntry> |
history()
Get the snapshot history of this table.
|
FileIO |
io()
Returns a
FileIO to read and write table data and metadata files. |
java.lang.String |
location()
Return the table's base location.
|
LocationProvider |
locationProvider()
Returns a
LocationProvider to provide locations for new data files. |
ManageSnapshots |
manageSnapshots()
Create a new
manage snapshots API to manage snapshots in this table and
commit. |
java.lang.String |
name()
Return the full name for this table.
|
AppendFiles |
newAppend()
Create a new
append API to add files to this table and commit. |
DeleteFiles |
newDelete()
Create a new
delete API to replace files in this table and commit. |
OverwriteFiles |
newOverwrite()
Create a new
overwrite API to overwrite files by a filter expression. |
ReplacePartitions |
newReplacePartitions()
Not recommended: Create a new
replace partitions API to dynamically
overwrite partitions in the table with new data. |
RewriteFiles |
newRewrite()
Create a new
rewrite API to replace files in this table and commit. |
RowDelta |
newRowDelta()
Create a new
row-level delta API to remove or replace rows in existing data
files. |
Transaction |
newTransaction()
Create a new
transaction API to commit multiple table operations at once. |
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 table
|
ReplaceSortOrder |
replaceSortOrder()
Create a new
ReplaceSortOrder to set the table sort order and commit the change. |
RewriteManifests |
rewriteManifests()
Create a new
rewrite manifests API to replace manifests for this table
and commit. |
java.util.Map<java.lang.Integer,Schema> |
schemas()
Return a map of
schema for this table. |
Snapshot |
snapshot(long snapshotId)
Get the
snapshot of this table with the given id, or null if there is no
matching snapshot. |
java.lang.Iterable<Snapshot> |
snapshots()
Get the
snapshots of this table. |
SortOrder |
sortOrder()
Return the
sort order for this table. |
java.util.Map<java.lang.Integer,SortOrder> |
sortOrders()
Return a map of sort order IDs to
sort orders for this table. |
PartitionSpec |
spec()
Return the
partition spec for this table. |
java.util.Map<java.lang.Integer,PartitionSpec> |
specs()
Return a map of
partition specs for this table. |
java.util.List<StatisticsFile> |
statisticsFiles()
Returns the current statistics files for the table
|
BaseTable |
table() |
java.lang.String |
toString() |
UpdateLocation |
updateLocation()
Create a new
UpdateLocation to update table location and commit the changes. |
UpdatePartitionStatistics |
updatePartitionStatistics()
Create a new
update partition statistics API to add or remove
partition statistics files in this table. |
UpdateProperties |
updateProperties()
Create a new
UpdateProperties to update table properties and commit the changes. |
UpdateSchema |
updateSchema()
Create a new
UpdateSchema to alter the columns of this table and commit the change. |
UpdatePartitionSpec |
updateSpec()
Create a new
UpdatePartitionSpec to alter the partition spec of this table and commit
the change. |
UpdateStatistics |
updateStatistics()
Create a new
update table statistics API to add or remove statistics
files in this table. |
java.util.UUID |
uuid()
Returns the UUID of the table
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitnewBatchScan, newFastAppend, newIncrementalAppendScan, newIncrementalChangelogScan, newScan, schema, snapshotprotected BaseMetadataTable(Table table, java.lang.String name)
public BaseTable table()
public java.lang.String name()
Tablepublic FileIO io()
TableFileIO to read and write table data and metadata files.public java.lang.String location()
Tablepublic EncryptionManager encryption()
TableEncryptionManager to encrypt and decrypt data
files.encryption in interface Tablepublic LocationProvider locationProvider()
TableLocationProvider to provide locations for new data files.locationProvider in interface Tablepublic void refresh()
Tablepublic java.util.Map<java.lang.Integer,Schema> schemas()
Tableschema for this table.public PartitionSpec spec()
Tablepartition spec for this table.public java.util.Map<java.lang.Integer,PartitionSpec> specs()
Tablepartition specs for this table.public SortOrder sortOrder()
Tablesort order for this table.public java.util.Map<java.lang.Integer,SortOrder> sortOrders()
Tablesort orders for this table.sortOrders in interface Tablepublic java.util.Map<java.lang.String,java.lang.String> properties()
Tableproperties in interface Tablepublic Snapshot currentSnapshot()
Tablesnapshot for this table, or null if there are no snapshots.currentSnapshot in interface Tablepublic java.lang.Iterable<Snapshot> snapshots()
Tablesnapshots of this table.public Snapshot snapshot(long snapshotId)
Tablesnapshot of this table with the given id, or null if there is no
matching snapshot.public java.util.List<HistoryEntry> history()
Tablehistory in interface Tablehistory entriespublic java.util.List<StatisticsFile> statisticsFiles()
TablestatisticsFiles in interface Tablepublic java.util.List<PartitionStatisticsFile> partitionStatisticsFiles()
TablepartitionStatisticsFiles in interface Tablepublic java.util.Map<java.lang.String,SnapshotRef> refs()
Tablepublic java.util.UUID uuid()
Tablepublic java.lang.String toString()
toString in class java.lang.Objectpublic UpdateSchema updateSchema()
TableUpdateSchema to alter the columns of this table and commit the change.updateSchema in interface TableUpdateSchemapublic UpdatePartitionSpec updateSpec()
TableUpdatePartitionSpec to alter the partition spec of this table and commit
the change.updateSpec in interface TableUpdatePartitionSpecpublic UpdateProperties updateProperties()
TableUpdateProperties to update table properties and commit the changes.updateProperties in interface TableUpdatePropertiespublic ReplaceSortOrder replaceSortOrder()
TableReplaceSortOrder to set the table sort order and commit the change.replaceSortOrder in interface TableReplaceSortOrderpublic UpdateLocation updateLocation()
TableUpdateLocation to update table location and commit the changes.updateLocation in interface TableUpdateLocationpublic AppendFiles newAppend()
Tableappend API to add files to this table and commit.newAppend in interface TableAppendFilespublic RewriteFiles newRewrite()
Tablerewrite API to replace files in this table and commit.newRewrite in interface TableRewriteFilespublic RewriteManifests rewriteManifests()
Tablerewrite manifests API to replace manifests for this table
and commit.rewriteManifests in interface TableRewriteManifestspublic OverwriteFiles newOverwrite()
Tableoverwrite API to overwrite files by a filter expression.newOverwrite in interface TableOverwriteFilespublic RowDelta newRowDelta()
Tablerow-level delta API to remove or replace rows in existing data
files.newRowDelta in interface TableRowDeltapublic ReplacePartitions newReplacePartitions()
Tablereplace 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.
newReplacePartitions in interface TableReplacePartitionspublic DeleteFiles newDelete()
Tabledelete API to replace files in this table and commit.newDelete in interface TableDeleteFilespublic UpdateStatistics updateStatistics()
Tableupdate table statistics API to add or remove statistics
files in this table.updateStatistics in interface TableUpdateStatisticspublic UpdatePartitionStatistics updatePartitionStatistics()
Tableupdate partition statistics API to add or remove
partition statistics files in this table.updatePartitionStatistics in interface TableUpdatePartitionStatisticspublic ExpireSnapshots expireSnapshots()
Tableexpire API to manage snapshots in this table and commit.expireSnapshots in interface TableExpireSnapshotspublic ManageSnapshots manageSnapshots()
Tablemanage snapshots API to manage snapshots in this table and
commit.manageSnapshots in interface TableManageSnapshotspublic Transaction newTransaction()
Tabletransaction API to commit multiple table operations at once.newTransaction in interface TableTransaction