| Constructor and Description |
|---|
TableImpl(String tablePath,
Clock clock) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkpoint(Engine engine,
long version)
Checkpoint the table at given version.
|
TransactionBuilder |
createTransactionBuilder(Engine engine,
String engineInfo,
Operation operation)
Create a
TransactionBuilder which can create a Transaction object to mutate the
table. |
static Table |
forPath(Engine engine,
String path)
Instantiate a table object for the Delta Lake table at the given path.
|
static Table |
forPath(Engine engine,
String path,
Clock clock)
Instantiate a table object for the Delta Lake table at the given path.
|
CloseableIterator<ColumnarBatch> |
getChanges(Engine engine,
long startVersion,
long endVersion,
java.util.Set<DeltaLogActionUtils.DeltaAction> actionSet)
Returns delta actions for each version between startVersion and endVersion.
|
Clock |
getClock() |
Snapshot |
getLatestSnapshot(Engine engine)
Get the latest snapshot of the table.
|
String |
getPath(Engine engine)
The fully qualified path of this
Table instance. |
Snapshot |
getSnapshotAsOfTimestamp(Engine engine,
long millisSinceEpochUTC)
Get the snapshot of the table at the given
timestamp. |
Snapshot |
getSnapshotAsOfVersion(Engine engine,
long versionId)
Get the snapshot at the given
versionId. |
long |
getVersionAtOrAfterTimestamp(Engine engine,
long millisSinceEpochUTC)
Returns the latest version that was committed at or after
millisSinceEpochUTC. |
long |
getVersionBeforeOrAtTimestamp(Engine engine,
long millisSinceEpochUTC)
Returns the latest version that was committed before or at
millisSinceEpochUTC. |
public TableImpl(String tablePath,
Clock clock)
public static Table forPath(Engine engine, String path)
TableTableNotFoundException
TableNotFoundException
public static Table forPath(Engine engine, String path, Clock clock)
Clock which helps in testing.public String getPath(Engine engine)
TableTable instance.public Snapshot getLatestSnapshot(Engine engine) throws TableNotFoundException
TablegetLatestSnapshot in interface Tableengine - Engine instance to use in Delta Kernel.SnapshotTableNotFoundException - if the table is not foundpublic Snapshot getSnapshotAsOfVersion(Engine engine, long versionId) throws TableNotFoundException
TableversionId.getSnapshotAsOfVersion in interface Tableengine - Engine instance to use in Delta Kernel.versionId - snapshot version to retrieveSnapshotTableNotFoundException - if the table is not foundpublic Snapshot getSnapshotAsOfTimestamp(Engine engine, long millisSinceEpochUTC) throws TableNotFoundException
Tabletimestamp. This is the latest version of the
table that was committed before or at timestamp.
Specifically:
getSnapshotAsOfTimestamp in interface Tableengine - Engine instance to use in Delta Kernel.millisSinceEpochUTC - timestamp to fetch the snapshot for in milliseconds since the unix
epochSnapshotTableNotFoundException - if the table is not foundpublic void checkpoint(Engine engine, long version) throws TableNotFoundException, CheckpointAlreadyExistsException, java.io.IOException
Tablecheckpoint in interface Tableengine - Engine instance to use.version - Version to checkpoint.TableNotFoundException - if the table is not foundCheckpointAlreadyExistsException - if a checkpoint already exists at the given versionjava.io.IOException - for any I/O error.public TransactionBuilder createTransactionBuilder(Engine engine, String engineInfo, Operation operation)
TableTransactionBuilder which can create a Transaction object to mutate the
table.createTransactionBuilder in interface Tableengine - Engine instance to use.engineInfo - information about the engine that is making the updates.operation - metadata of operation that is being performed. E.g. "insert", "delete".TransactionBuilder instance to build the transaction.public Clock getClock()
public CloseableIterator<ColumnarBatch> getChanges(Engine engine, long startVersion, long endVersion, java.util.Set<DeltaLogActionUtils.DeltaAction> actionSet)
For the returned columnar batches:
DeltaAction.schema.
engine - Engine instance to use in Delta Kernel.startVersion - start version (inclusive)endVersion - end version (inclusive)actionSet - the actions to read and return from the JSON log filesTableNotFoundException - if the table does not exist or if it is not a delta tableKernelException - if a commit file does not exist for any of the versions in the provided
rangeKernelException - if provided an invalid version rangeKernelException - if the version range contains a version with reader protocol that is
unsupported by Kernelpublic long getVersionBeforeOrAtTimestamp(Engine engine, long millisSinceEpochUTC)
millisSinceEpochUTC. If no
version exists, throws a KernelException
Specifically:
millisSinceEpochUTC - the number of milliseconds since midnight, January 1, 1970 UTCtimestamp.KernelException - if the timestamp is less than the timestamp of any committed versionTableNotFoundException - if no delta table is foundpublic long getVersionAtOrAfterTimestamp(Engine engine, long millisSinceEpochUTC)
millisSinceEpochUTC. If no
version exists, throws a KernelException
Specifically:
millisSinceEpochUTC - the number of milliseconds since midnight, January 1, 1970 UTCtimestamp.KernelException - if the timestamp is more than the timestamp of any committed versionTableNotFoundException - if no delta table is found