pub struct DeltaV1Client { /* private fields */ }Expand description
Client for the /delta/v1/ Delta REST API.
Constructed from a CloudClient (carrying auth) and the Unity Catalog base
URL. Prefer UnityCatalogClient::delta_v1.
Implementations§
Source§impl DeltaV1Client
impl DeltaV1Client
Sourcepub fn new(client: CloudClient, base_url: Url) -> Self
pub fn new(client: CloudClient, base_url: Url) -> Self
Create a new Delta v1 client. base_url is normalized to end in / so it
joins cleanly with the relative endpoint paths.
Sourcepub async fn get_config(
&self,
catalog: &str,
protocol_versions: &str,
) -> Result<DeltaCatalogConfig>
pub async fn get_config( &self, catalog: &str, protocol_versions: &str, ) -> Result<DeltaCatalogConfig>
Get catalog configuration and supported endpoints —
GET /delta/v1/config?catalog={catalog}&protocol-versions={versions}.
This is the protocol-negotiation entry point: the client advertises the
highest protocol versions it supports per major version (protocol_versions,
e.g. "1.1,2.3") and the server returns the endpoints it supports for the
newest mutually supported version. Used to discover whether the
/delta/v1 surface is available before falling back to the legacy API.
Sourcepub async fn create_staging_table(
&self,
catalog: &str,
schema: &str,
request: &DeltaCreateStagingTableRequest,
) -> Result<DeltaStagingTableResponse>
pub async fn create_staging_table( &self, catalog: &str, schema: &str, request: &DeltaCreateStagingTableRequest, ) -> Result<DeltaStagingTableResponse>
Create a staging table — POST /delta/v1/catalogs/{catalog}/schemas/{schema}/staging-tables.
Allocates an immutable table id and a managed storage location, and
advertises the catalog-managed contract (required/suggested protocol +
properties) plus READ_WRITE credentials for writing the initial
_delta_log/0.json. The catalog/schema are taken from the path; the
request body carries only the table name.
Sourcepub async fn create_table(
&self,
catalog: &str,
schema: &str,
request: &DeltaCreateTableRequest,
) -> Result<DeltaLoadTableResponse>
pub async fn create_table( &self, catalog: &str, schema: &str, request: &DeltaCreateTableRequest, ) -> Result<DeltaLoadTableResponse>
Finalize a managed table from its staging reservation —
POST /delta/v1/catalogs/{catalog}/schemas/{schema}/tables.
Called after the client has written _delta_log/0.json (carrying the
required features/properties, including io.unitycatalog.tableId) to the
staging location. The server validates the contract and registers the
table at version 0.
Sourcepub async fn load_table(
&self,
catalog: &str,
schema: &str,
table: &str,
) -> Result<DeltaLoadTableResponse>
pub async fn load_table( &self, catalog: &str, schema: &str, table: &str, ) -> Result<DeltaLoadTableResponse>
Load a Delta table’s metadata, unbackfilled CCv2 commits, and latest
ratified version — GET /delta/v1/catalogs/{catalog}/schemas/{schema}/tables/{table}.
For a catalog-managed (MANAGED) table the response carries the commits
log tail and latest_table_version a reader needs to materialize the
catalog’s ratified snapshot.
Sourcepub async fn update_table(
&self,
catalog: &str,
schema: &str,
table: &str,
request: &DeltaUpdateTableRequest,
) -> Result<DeltaLoadTableResponse>
pub async fn update_table( &self, catalog: &str, schema: &str, table: &str, request: &DeltaUpdateTableRequest, ) -> Result<DeltaLoadTableResponse>
Update a table — POST /delta/v1/catalogs/{catalog}/schemas/{schema}/tables/{table}.
This is the catalog-managed commit surface: the add-commit action
proposes a staged commit (the server ratifies iff version == last + 1,
returning 409 on conflict), and set-latest-backfilled-version notifies
the catalog that commits up to a version have been published into
_delta_log/. Metadata/property/schema changes ride the same call.
Sourcepub async fn delete_table(
&self,
catalog: &str,
schema: &str,
table: &str,
) -> Result<()>
pub async fn delete_table( &self, catalog: &str, schema: &str, table: &str, ) -> Result<()>
Delete a table — DELETE /delta/v1/catalogs/{catalog}/schemas/{schema}/tables/{table}.
The server responds 204 No Content on success.
Sourcepub async fn table_exists(
&self,
catalog: &str,
schema: &str,
table: &str,
) -> Result<bool>
pub async fn table_exists( &self, catalog: &str, schema: &str, table: &str, ) -> Result<bool>
Check whether a table exists —
HEAD /delta/v1/catalogs/{catalog}/schemas/{schema}/tables/{table}.
Returns Ok(true) on 204, Ok(false) on 404, and an error for any
other non-success status. A HEAD response carries no body, so a 404 here
is mapped directly rather than parsed as a Delta error envelope.
Sourcepub async fn rename_table(
&self,
catalog: &str,
schema: &str,
table: &str,
request: &DeltaRenameTableRequest,
) -> Result<()>
pub async fn rename_table( &self, catalog: &str, schema: &str, table: &str, request: &DeltaRenameTableRequest, ) -> Result<()>
Rename a table within the same catalog and schema —
POST /delta/v1/catalogs/{catalog}/schemas/{schema}/tables/{table}/rename.
Cross-schema and cross-catalog moves are not supported. The server responds
204 No Content on success.
Sourcepub async fn get_table_credentials(
&self,
catalog: &str,
schema: &str,
table: &str,
operation: DeltaCredentialOperation,
) -> Result<DeltaCredentialsResponse>
pub async fn get_table_credentials( &self, catalog: &str, schema: &str, table: &str, operation: DeltaCredentialOperation, ) -> Result<DeltaCredentialsResponse>
Vend temporary credentials for a table’s data —
GET /delta/v1/catalogs/{catalog}/schemas/{schema}/tables/{table}/credentials?operation={op}.
operation scopes the credential to READ or READ_WRITE access.
Sourcepub async fn get_staging_table_credentials(
&self,
table_id: &str,
) -> Result<DeltaCredentialsResponse>
pub async fn get_staging_table_credentials( &self, table_id: &str, ) -> Result<DeltaCredentialsResponse>
Vend READ_WRITE credentials for a staging table identified by its UUID —
GET /delta/v1/staging-tables/{table_id}/credentials.
A staging table is globally identified by its UUID (no catalog/schema). This is how staging-phase credentials are refreshed while the client writes the initial commit.
Sourcepub async fn get_temporary_path_credentials(
&self,
location: &str,
operation: DeltaCredentialOperation,
) -> Result<DeltaCredentialsResponse>
pub async fn get_temporary_path_credentials( &self, location: &str, operation: DeltaCredentialOperation, ) -> Result<DeltaCredentialsResponse>
Vend temporary credentials for a storage path (for creating a new external
table) — GET /delta/v1/temporary-path-credentials?location={location}&operation={op}.
The path is not yet part of any catalog/namespace, so it is passed as a query parameter rather than a path segment.
Sourcepub async fn report_metrics(
&self,
catalog: &str,
schema: &str,
table: &str,
request: &DeltaReportMetricsRequest,
) -> Result<()>
pub async fn report_metrics( &self, catalog: &str, schema: &str, table: &str, request: &DeltaReportMetricsRequest, ) -> Result<()>
Report commit metrics (telemetry) for a table —
POST /delta/v1/catalogs/{catalog}/schemas/{schema}/tables/{table}/metrics.
The path {table} and the body table-id must identify the same table.
The server responds 204 No Content on success.
Trait Implementations§
Source§impl Clone for DeltaV1Client
impl Clone for DeltaV1Client
Source§fn clone(&self) -> DeltaV1Client
fn clone(&self) -> DeltaV1Client
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more