Skip to main content

DeltaV1Client

Struct DeltaV1Client 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> DeltaV1Client

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more