public class BaseTable extends java.lang.Object implements Table, HasTableOperations
Table implementation.
This can be extended by providing a TableOperations to the constructor.
| Constructor and Description |
|---|
BaseTable(TableOperations ops,
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() |
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() |
java.lang.String |
location()
Return the table's base location.
|
LocationProvider |
locationProvider() |
ManageSnapshots |
manageSnapshots()
Create a new
manage snapshots API to manage snapshots in this table and commit. |
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. |
AppendFiles |
newFastAppend()
Create a new
append API to add files to 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. |
TableScan |
newScan()
Create a new
scan for this table. |
Transaction |
newTransaction()
Create a new
transaction API to commit multiple table operations at once. |
TableOperations |
operations() |
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.
|
RewriteManifests |
rewriteManifests()
Create a new
rewrite manifests API to replace manifests for this
table and commit. |
Rollback |
rollback()
Create a new
rollback API to roll back to a previous snapshot and commit. |
Schema |
schema()
Return the
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. |
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.lang.String |
toString() |
UpdateLocation |
updateLocation()
Create a new
UpdateLocation to update table location and commit the changes. |
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. |
public BaseTable(TableOperations ops, java.lang.String name)
public TableOperations operations()
operations in interface HasTableOperationspublic void refresh()
Tablepublic TableScan newScan()
Tablescan for this table.
Once a table scan is created, it can be refined to project columns and filter data.
public Schema schema()
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 java.util.Map<java.lang.String,java.lang.String> properties()
Tableproperties in interface Tablepublic java.lang.String location()
Tablepublic Snapshot currentSnapshot()
Tablesnapshot for this table, or null if there are no snapshots.currentSnapshot in interface Tablepublic Snapshot snapshot(long snapshotId)
Tablesnapshot of this table with the given id, or null if there is no
matching snapshot.public java.lang.Iterable<Snapshot> snapshots()
Tablesnapshots of this table.public java.util.List<HistoryEntry> history()
Tablehistory in interface Tablehistory entriespublic UpdateSchema updateSchema()
TableUpdateSchema to alter the columns of this table and commit the change.updateSchema in interface TableUpdateSchemapublic UpdateProperties updateProperties()
TableUpdateProperties to update table properties and commit the changes.updateProperties in interface TableUpdatePropertiespublic 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 AppendFiles newFastAppend()
Tableappend 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().
newFastAppend 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 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 ExpireSnapshots expireSnapshots()
Tableexpire API to manage snapshots in this table and commit.expireSnapshots in interface TableExpireSnapshotspublic Rollback rollback()
Tablerollback API to roll back to a previous snapshot and commit.public 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 TableTransactionpublic FileIO io()
public EncryptionManager encryption()
encryption in interface TableEncryptionManager to encrypt and decrypt
data files.public LocationProvider locationProvider()
locationProvider in interface TableLocationProvider to provide locations for new data filespublic java.lang.String toString()
toString in class java.lang.Object