Interface Table
-
- All Known Implementing Classes:
AllDataFilesTable,AllDeleteFilesTable,AllEntriesTable,AllFilesTable,AllManifestsTable,BaseMetadataTable,BaseTable,BaseTransaction.TransactionTable,DataFilesTable,DeleteFilesTable,FilesTable,HistoryTable,ManifestEntriesTable,ManifestsTable,PartitionsTable,SerializableTable,SerializableTable.SerializableMetadataTable,SerializableTableWithSize,SerializableTableWithSize.SerializableMetadataTableWithSize,SnapshotsTable
public interface TableRepresents a table.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated 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.default 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.default AppendFilesnewFastAppend()Create a newappend APIto add files to this table and commit.default IncrementalAppendScannewIncrementalAppendScan()Create a newscanfor this table.default IncrementalChangelogScannewIncrementalChangelogScan()Create a newIncrementalChangelogScanfor 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.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()Deprecated.Replaced bymanageSnapshots()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.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.
-
-
-
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 newscanfor 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
-
newIncrementalAppendScan
default IncrementalAppendScan newIncrementalAppendScan()
Create a newscanfor 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 newIncrementalChangelogScanfor 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 ofschemafor this table.- Returns:
- this table's schema map
-
spec
PartitionSpec spec()
Return thepartition specfor this table.- Returns:
- this table's partition spec
-
specs
java.util.Map<java.lang.Integer,PartitionSpec> specs()
Return a map ofpartition specsfor this table.- Returns:
- this table's partition specs map
-
sortOrder
SortOrder sortOrder()
Return thesort orderfor 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 ordersfor 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 currentsnapshotfor this table, or null if there are no snapshots.- Returns:
- the current table Snapshot.
-
snapshot
Snapshot snapshot(long snapshotId)
Get thesnapshotof this table with the given id, or null if there is no matching snapshot.- Returns:
- the
Snapshotwith the given id.
-
snapshots
java.lang.Iterable<Snapshot> snapshots()
Get thesnapshotsof 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 newUpdateSchemato alter the columns of this table and commit the change.- Returns:
- a new
UpdateSchema
-
updateSpec
UpdatePartitionSpec updateSpec()
Create a newUpdatePartitionSpecto alter the partition spec of this table and commit the change.- Returns:
- a new
UpdatePartitionSpec
-
updateProperties
UpdateProperties updateProperties()
Create a newUpdatePropertiesto update table properties and commit the changes.- Returns:
- a new
UpdateProperties
-
replaceSortOrder
ReplaceSortOrder replaceSortOrder()
Create a newReplaceSortOrderto set the table sort order and commit the change.- Returns:
- a new
ReplaceSortOrder
-
updateLocation
UpdateLocation updateLocation()
Create a newUpdateLocationto update table location and commit the changes.- Returns:
- a new
UpdateLocation
-
newAppend
AppendFiles newAppend()
Create a newappend APIto add files to this table and commit.- Returns:
- a new
AppendFiles
-
newFastAppend
default AppendFiles newFastAppend()
Create 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
newAppend().- Returns:
- a new
AppendFiles
-
newRewrite
RewriteFiles newRewrite()
Create a newrewrite APIto replace files in this table and commit.- Returns:
- a new
RewriteFiles
-
rewriteManifests
RewriteManifests rewriteManifests()
Create a newrewrite manifests APIto replace manifests for this table and commit.- Returns:
- a new
RewriteManifests
-
newOverwrite
OverwriteFiles newOverwrite()
Create a newoverwrite APIto overwrite files by a filter expression.- Returns:
- a new
OverwriteFiles
-
newRowDelta
RowDelta newRowDelta()
Create a newrow-level delta APIto remove or replace rows in existing data files.- Returns:
- a new
RowDelta
-
newReplacePartitions
ReplacePartitions newReplacePartitions()
Not 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.- Returns:
- a new
ReplacePartitions
-
newDelete
DeleteFiles newDelete()
Create a newdelete APIto replace files in this table and commit.- Returns:
- a new
DeleteFiles
-
expireSnapshots
ExpireSnapshots expireSnapshots()
Create a newexpire APIto manage snapshots in this table and commit.- Returns:
- a new
ExpireSnapshots
-
rollback
@Deprecated Rollback rollback()
Deprecated.Replaced bymanageSnapshots()Create a newrollback APIto roll back to a previous snapshot and commit.- Returns:
- a new
Rollback
-
manageSnapshots
ManageSnapshots manageSnapshots()
Create a newmanage snapshots APIto manage snapshots in this table and commit.- Returns:
- a new
ManageSnapshots
-
newTransaction
Transaction newTransaction()
Create a newtransaction APIto commit multiple table operations at once.- Returns:
- a new
Transaction
-
encryption
EncryptionManager encryption()
Returns anEncryptionManagerto encrypt and decrypt data files.
-
locationProvider
LocationProvider locationProvider()
Returns aLocationProviderto provide locations for new data files.
-
-