Package io.delta.kernel.unitycatalog
Class UCCatalogManagedClient
Object
io.delta.kernel.unitycatalog.UCCatalogManagedClient
Client for interacting with Unity Catalog (UC) catalog-managed Delta tables.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUCCatalogManagedClient(io.delta.storage.commit.uccommitcoordinator.UCClient ucClient) -
Method Summary
Modifier and TypeMethodDescriptionio.delta.kernel.transaction.CreateTableTransactionBuilderbuildCreateTableTransaction(String ucTableId, String tablePath, io.delta.kernel.types.StructType schema, String engineInfo) Deprecated.io.delta.kernel.transaction.CreateTableTransactionBuilderbuildCreateTableTransaction(String ucTableId, String tablePath, io.delta.kernel.types.StructType schema, String engineInfo, UCTableIdentifier ucTableIdentifier) Builds a create table transaction with automatic UC finalization.io.delta.kernel.CommitRangeloadCommitRange(io.delta.kernel.engine.Engine engine, String ucTableId, String tablePath, Optional<Long> startVersionOpt, Optional<Long> startTimestampOpt, Optional<Long> endVersionOpt, Optional<Long> endTimestampOpt) Loads a KernelCommitRangefor the provided boundaries.io.delta.kernel.SnapshotloadSnapshot(io.delta.kernel.engine.Engine engine, String ucTableId, String tablePath, Optional<Long> versionOpt, Optional<Long> timestampOpt) Loads a KernelSnapshot.
-
Field Details
-
UC_PROPERTY_NAMESPACE_PREFIX
- See Also:
-
UC_TABLE_ID_KEY
Key for identifying Unity Catalog table ID.- See Also:
-
-
Constructor Details
-
UCCatalogManagedClient
public UCCatalogManagedClient(io.delta.storage.commit.uccommitcoordinator.UCClient ucClient)
-
-
Method Details
-
loadSnapshot
public io.delta.kernel.Snapshot loadSnapshot(io.delta.kernel.engine.Engine engine, String ucTableId, String tablePath, Optional<Long> versionOpt, Optional<Long> timestampOpt) Loads a KernelSnapshot. If no version is specified, the latest version of the table is loaded.- Parameters:
engine- The Delta KernelEngineto use for loading the table.ucTableId- The Unity Catalog table ID, which is a unique identifier for the table in UC.tablePath- The path to the Delta table in the underlying storage system.versionOpt- The optional version to time-travel to when loading the table. This must be mutually exclusive with timestampOpt.timestampOpt- The optional timestamp to time-travel to when loading the table. This must be mutually exclusive with versionOpt.- Throws:
IllegalArgumentException- if a negative version or timestamp is providedIllegalArgumentException- if both versionOpt and timestampOpt are defined
-
buildCreateTableTransaction
@Deprecated public io.delta.kernel.transaction.CreateTableTransactionBuilder buildCreateTableTransaction(String ucTableId, String tablePath, io.delta.kernel.types.StructType schema, String engineInfo) Deprecated.UsebuildCreateTableTransaction(String, String, StructType, String, UCTableIdentifier)which automatically finalizes the table.Builds a create table transaction for a Unity Catalog managed Delta table.Configures the transaction with a
UCCatalogManagedCommitterand required table properties for catalog-managed table enablement.This assumes the table is being created in a staging location as per UC semantics. Once this transaction is built and committed, creating 000.json, you must call
TablesApi::createTableto inform Unity Catalog of the successful table creation.- Parameters:
ucTableId- The Unity Catalog table ID.tablePath- The staging path to the Delta table.schema- The table schema.engineInfo- Information about the creating engine.- Returns:
- A
CreateTableTransactionBuilderconfigured for UC managed tables.
-
buildCreateTableTransaction
public io.delta.kernel.transaction.CreateTableTransactionBuilder buildCreateTableTransaction(String ucTableId, String tablePath, io.delta.kernel.types.StructType schema, String engineInfo, UCTableIdentifier ucTableIdentifier) Builds a create table transaction with automatic UC finalization. When committed, the committer writes 000.json and then calls UC to finalize (promote) the staging table.- Parameters:
ucTableIdentifier- Logical UC table identifier for create-time registration.
-
loadCommitRange
public io.delta.kernel.CommitRange loadCommitRange(io.delta.kernel.engine.Engine engine, String ucTableId, String tablePath, Optional<Long> startVersionOpt, Optional<Long> startTimestampOpt, Optional<Long> endVersionOpt, Optional<Long> endTimestampOpt) Loads a KernelCommitRangefor the provided boundaries. If no end boundary is provided, defaults to the latest version.A start boundary is required and must be specified using either
startVersionOptorstartTimestampOpt. These parameters are mutually exclusive and at least one must be provided.- Parameters:
engine- The Delta KernelEngineto use for loading the table.ucTableId- The Unity Catalog table ID, which is a unique identifier for the table in UC.tablePath- The path to the Delta table in the underlying storage system.startVersionOpt- The optional start version boundary. This must be mutually exclusive with startTimestampOpt. Either this or startTimestampOpt must be provided.startTimestampOpt- The optional start timestamp boundary. This must be mutually exclusive with startVersionOpt. Either this or startVersionOpt must be provided.endVersionOpt- The optional end version boundary. This must be mutually exclusive with endTimestampOpt.endTimestampOpt- The optional end timestamp boundary. This must be mutually exclusive with endVersionOpt.- Throws:
IllegalArgumentException- if neither startVersionOpt nor startTimestampOpt is providedIllegalArgumentException- if both startVersionOpt and startTimestampOpt are definedIllegalArgumentException- if both endVersionOpt and endTimestampOpt are definedIllegalArgumentException- if either startVersionOpt or endVersionOpt is provided and is greater than the latest ratified version from UC
-
buildCreateTableTransaction(String, String, StructType, String, UCTableIdentifier)which automatically finalizes the table.