Skip to content

unitycatalog.delta

The classes of the delta API.

Classes

Name Description
ColumnInfos The columns of a Delta metadata change.
DeltaApiCommit A commit of a catalog-managed table.
DeltaCatalogConfig The configuration of the Delta API for a catalog.
DeltaClusteringDomainMetadata The domain metadata of a clustered table.
DeltaCommitInfo One Delta commit file.
DeltaCommitMetadataProperties The properties of a Delta metadata change.
DeltaCommitReport The metrics of a commit.
DeltaCredentialsResponse Temporary credentials for the data of a table.
DeltaDomainMetadataUpdates Domain metadata entries, by domain name.
DeltaFileSizeHistogram A file size histogram of a commit.
DeltaGetCommitsResponse The commits that the server tracks for a table.
DeltaLoadTableResponse A Delta table: its metadata and, for a MANAGED table, its commits that are not backfilled yet.
DeltaMetadata A Delta metadata change to apply to the table with the commit. At least one field must be set.
DeltaMetricsReport The reported metrics.
DeltaProtocol Delta protocol versions and features.
DeltaRowTrackingDomainMetadata The domain metadata of a table with row tracking.
DeltaStagingTableResponse A staging table: the table id and storage location that the server reserves for a new MANAGED table, and what the first commit must contain.
DeltaStorageCredential A temporary credential for a storage prefix. When more than one credential applies, use the one with the longest prefix.
DeltaStorageCredentialConfig Cloud credential settings. Only the keys of one cloud provider are set.
DeltaStructField A field of a Delta struct type, as in the Delta protocol schema format.
DeltaStructType A Delta struct type, such as the columns of a table.
DeltaSuggestedProtocol Features that a client should enable when it can.
DeltaTableMetadata The metadata of a Delta table.
DeltaTableRequirement A precondition of a table update. The type says which field is set: - assert-table-uuid: uuid, the expected table id. - assert-etag: etag, the expected entity tag of the metadata.
DeltaTableUpdate One update action. The action says which fields are set: - set-properties: updates, property names to string values. - remove-properties: removals. - set-columns: columns. - set-table-comment: comment. - add-commit: commit and uniform. - set-latest-backfilled-version: latest_published_version. - set-protocol: protocol. - set-domain-metadata: updates, domain names to their metadata: delta.clustering to {"clusteringColumns": [["a"], ["b", "c"]]}, delta.rowTracking to {"rowIdHighWaterMark": 9}. - remove-domain-metadata: domains. - set-partition-columns: partition_columns. - update-metadata-snapshot-version: last_commit_version and last_commit_timestamp_ms.
DeltaUniform UniForm metadata committed with a Delta commit.
DeltaUniformIceberg The Iceberg metadata of a UniForm table.
DeltaUniformMetadata UniForm conversion metadata. Only UniForm (Delta and Iceberg) tables have it.
DeltaUniformMetadataIceberg The Iceberg metadata of a UniForm table.

Enums

Name Description
DeltaCredentialOperation The access level of a storage credential.
DeltaMaintenanceOperation A maintenance operation that the catalog allows on a table, in addition to the operations that the Delta protocol allows.
DeltaTableType The type of a Delta table.

class unitycatalog.delta.ColumnInfos(*, columns: SupportsGetItem[int, ColumnInfo] | None = None)

The columns of a Delta metadata change.

Attributes

  • columns (list[ColumnInfo]) – The columns of the table.

class unitycatalog.delta.DeltaApiCommit(version: SupportsIndex,timestamp: SupportsIndex,file_name: str,file_size: SupportsIndex,file_modification_timestamp: SupportsIndex,)

A commit of a catalog-managed table.

Attributes

  • file_modification_timestamp (int) – Time at which the commit file was last changed, in epoch milliseconds.
  • file_name (str) – Name of the staged commit file under _delta_log/_staged_commits, without a path.
  • file_size (int) – Size of the commit file, in bytes.
  • timestamp (int) – The in-commit timestamp, in epoch milliseconds.
  • version (int) – Version of the commit.

class unitycatalog.delta.DeltaCatalogConfig

The configuration of the Delta API for a catalog.

Attributes

  • endpoints (list[str]) – The endpoints that the server supports, such as GET /v1/catalogs/main/schemas/{schema}/tables/{table}.
  • protocol_version (str) – The protocol version of the endpoints, such as 1.0.

class unitycatalog.delta.DeltaClusteringDomainMetadata(*, clustering_columns: Any | None = None)

The domain metadata of a clustered table.

Attributes

  • clustering_columns (list[list[Any]]) – The clustering columns. Each one is a list of strings: the path from the root of the schema to the column, with physical names when column mapping is on. An empty list is sent too: the table is clustered by no columns.

class unitycatalog.delta.DeltaCommitInfo(version: SupportsIndex,timestamp: SupportsIndex,file_name: str,file_size: SupportsIndex,file_modification_timestamp: SupportsIndex,)

One Delta commit file.

Attributes

  • file_modification_timestamp (int) – Time at which the commit file was last changed, in epoch milliseconds. It must be positive.
  • file_name (str) – Name of the commit file under _delta_log/_staged_commits, without a path.
  • file_size (int) – Size of the commit file, in bytes. It must be positive.
  • timestamp (int) – The in-commit timestamp that the client wrote, in epoch milliseconds. It must be positive.
  • version (int) – Version of the commit. It must be positive.

class unitycatalog.delta.DeltaCommitMetadataProperties(*, properties: dict[str, str] | None = None)

The properties of a Delta metadata change.

Attributes

  • properties (dict[str, str]) – The properties of the table. They replace the properties of the table.

class unitycatalog.delta.DeltaCommitReport(*,num_files_added: SupportsIndex | None = None,num_bytes_added: SupportsIndex | None = None,num_files_removed: SupportsIndex | None = None,num_bytes_removed: SupportsIndex | None = None,num_rows_inserted: SupportsIndex | None = None,num_rows_removed: SupportsIndex | None = None,num_rows_updated: SupportsIndex | None = None,file_size_histogram: DeltaFileSizeHistogram | None = None,)

The metrics of a commit.

Attributes

  • file_size_histogram (DeltaFileSizeHistogram | None) – File counts and total bytes by file size.
  • num_bytes_added (int | None) – Number of bytes that the commit added.
  • num_bytes_removed (int | None) – Number of bytes that the commit removed.
  • num_files_added (int | None) – Number of files that the commit added.
  • num_files_removed (int | None) – Number of files that the commit removed.
  • num_rows_inserted (int | None) – Number of rows that the commit inserted.
  • num_rows_removed (int | None) – Number of rows that the commit removed.
  • num_rows_updated (int | None) – Number of rows that the commit updated.

class unitycatalog.delta.DeltaCredentialsResponse

Temporary credentials for the data of a table.

Attributes

class unitycatalog.delta.DeltaDomainMetadataUpdates(*,delta_clustering: DeltaClusteringDomainMetadata | None = None,delta_row_tracking: DeltaRowTrackingDomainMetadata | None = None,)

Domain metadata entries, by domain name.

Attributes

class unitycatalog.delta.DeltaFileSizeHistogram(*,sorted_bin_boundaries: SupportsGetItem[int, SupportsIndex] | None = None,file_counts: SupportsGetItem[int, SupportsIndex] | None = None,total_bytes: SupportsGetItem[int, SupportsIndex] | None = None,commit_version: SupportsIndex | None = None,)

A file size histogram of a commit.

Attributes

  • commit_version (int | None) – Version of the commit that the histogram is for.
  • file_counts (list[int]) – Number of files in each bin.
  • sorted_bin_boundaries (list[int]) – Start of each bin (inclusive), in bytes, sorted. The first one is 0.
  • total_bytes (list[int]) – Total bytes in each bin.

class unitycatalog.delta.DeltaGetCommitsResponse

The commits that the server tracks for a table.

Attributes

  • commits (list[DeltaCommitInfo]) – The commits that are not backfilled yet, newest first.
  • latest_table_version (int) – The latest version that the server tracks; 0 before the first commit.

class unitycatalog.delta.DeltaLoadTableResponse

A Delta table: its metadata and, for a MANAGED table, its commits that are not backfilled yet.

Attributes

  • allowed_maintenance_operations (list[DeltaMaintenanceOperation]) – Maintenance operations that the catalog allows in addition to the Delta protocol defaults.
  • commits (list[DeltaApiCommit]) – The commits that are not backfilled yet, newest first. Only for MANAGED tables.
  • latest_table_version (int | None) – The latest version that the server tracks, data-only commits included. Only for MANAGED tables.
  • metadata (DeltaTableMetadata | None) – The metadata of the table.
  • uniform (DeltaUniformMetadata | None) – UniForm conversion metadata. Only for UniForm tables.

class unitycatalog.delta.DeltaMetadata(*,description: str | None = None,schema: ColumnInfos | None = None,properties: DeltaCommitMetadataProperties | None = None,)

A Delta metadata change to apply to the table with the commit. At least one field must be set.

Attributes

  • description (str | None) – The comment of the table.
  • properties (DeltaCommitMetadataProperties | None) – The properties of the table.
  • schema (ColumnInfos | None) – The columns of the table. They replace the columns of the table.

class unitycatalog.delta.DeltaMetricsReport(*, commit_report: DeltaCommitReport | None = None)

The reported metrics.

Attributes

class unitycatalog.delta.DeltaProtocol(*,min_reader_version: SupportsIndex | None = None,min_writer_version: SupportsIndex | None = None,reader_features: SupportsGetItem[int, str] | None = None,writer_features: SupportsGetItem[int, str] | None = None,)

Delta protocol versions and features.

Attributes

  • min_reader_version (int | None) – Minimum reader version.
  • min_writer_version (int | None) – Minimum writer version.
  • reader_features (list[str]) – The reader features, such as deletionVectors.
  • writer_features (list[str]) – The writer features, such as catalogManaged.

class unitycatalog.delta.DeltaRowTrackingDomainMetadata(*, row_id_high_water_mark: SupportsIndex | None = None)

The domain metadata of a table with row tracking.

Attributes

  • row_id_high_water_mark (int | None) – The highest row id given so far.

class unitycatalog.delta.DeltaStagingTableResponse

A staging table: the table id and storage location that the server reserves for a new MANAGED table, and what the first commit must contain.

Attributes

  • location (str) – The storage location of the table.
  • required_properties (dict[str, Any]) – Table properties that the table must have. Each value is a string, or null when any valid value is allowed.
  • required_protocol (DeltaProtocol | None) – The protocol that the first commit must have at least.
  • storage_credentials (list[DeltaStorageCredential]) – Temporary credentials to write the first commit.
  • suggested_properties (dict[str, Any]) – Table properties that the table should have. Each value is a string, or null when the client makes the value.
  • suggested_protocol (DeltaSuggestedProtocol | None) – Features that the client should enable when it can.
  • table_id (str) – Unique identifier of the table.
  • table_type (DeltaTableType | None) – Type of the table. Always MANAGED.

class unitycatalog.delta.DeltaStorageCredential

A temporary credential for a storage prefix. When more than one credential applies, use the one with the longest prefix.

Attributes

  • config (DeltaStorageCredentialConfig | None) – The cloud credential settings.
  • expiration_time_ms (int | None) – Time at which the credential expires, in epoch milliseconds.
  • operation (DeltaCredentialOperation | None) – The access level of the credential.
  • prefix (str) – The storage path prefix that the credential is for.

class unitycatalog.delta.DeltaStorageCredentialConfig

Cloud credential settings. Only the keys of one cloud provider are set.

Attributes

  • azure_sas_token (str | None) – Azure SAS (shared access signature) token.
  • gcs_oauth_token (str | None) – GCP OAuth token.
  • s3_access_key_id (str | None) – AWS access key id.
  • s3_secret_access_key (str | None) – AWS secret access key.
  • s3_session_token (str | None) – AWS session token of the temporary credentials.

class unitycatalog.delta.DeltaStructField(name: str,data_type: Any,nullable: bool,metadata: Any,)

A field of a Delta struct type, as in the Delta protocol schema format.

Attributes

  • data_type (Any) – Data type of the field: a string for a primitive type (long, decimal(10,2)), or an object with a type of array (element-type, contains-null), map (key-type, value-type, value-contains-null), struct (fields) or decimal (precision, scale).
  • metadata (dict[str, Any] | None) – Metadata of the field, such as comment or delta.columnMapping.id. An empty object when there is none.
  • name (str) – Name of the field. It is unique in its struct, case-insensitively.
  • nullable (bool) – Whether the field can hold null values.

class unitycatalog.delta.DeltaStructType(fields: SupportsGetItem[int, DeltaStructField],*,type_name: str | None = None,)

A Delta struct type, such as the columns of a table.

Attributes

  • fields (list[DeltaStructField]) – The fields of the struct. At least one.
  • type_name (str) – The type name. Always struct.

class unitycatalog.delta.DeltaSuggestedProtocol

Features that a client should enable when it can.

Attributes

  • reader_features (list[str]) – The suggested reader features.
  • writer_features (list[str]) – The suggested writer features.

class unitycatalog.delta.DeltaTableMetadata

The metadata of a Delta table.

Attributes

  • columns (DeltaStructType | None) – The columns of the table.
  • created_time (int) – Time at which the table was created, in epoch milliseconds.
  • etag (str) – Entity tag of the metadata. It changes when the metadata changes.
  • last_commit_timestamp_ms (int | None) – Timestamp of the last commit that changed the metadata, in epoch milliseconds.
  • last_commit_version (int | None) – Version of the last commit that changed the metadata.
  • location (str) – Storage location of the table.
  • partition_columns (list[str]) – Names of the partition columns.
  • properties (dict[str, str]) – The table properties, with keys that the server derives (delta.minReaderVersion, delta.feature.*, delta.lastUpdateVersion, ...). Clients must not write those back.
  • table_type (DeltaTableType | None) – Type of the table.
  • table_uuid (str) – Unique identifier of the table.
  • updated_time (int) – Time at which the table was last changed, in epoch milliseconds.

class unitycatalog.delta.DeltaTableRequirement(requirement_type: str,*,uuid: str | None = None,etag: str | None = None,)

A precondition of a table update. The type says which field is set: - assert-table-uuid: uuid, the expected table id. - assert-etag: etag, the expected entity tag of the metadata.

Attributes

  • etag (str | None) – The expected entity tag of the table metadata. For assert-etag.
  • requirement_type (str) – Kind of the requirement, the JSON type: assert-table-uuid or assert-etag.
  • uuid (str | None) – The expected unique identifier of the table. For assert-table-uuid.

class unitycatalog.delta.DeltaTableUpdate(action: str,*,updates: Any | None = None,removals: SupportsGetItem[int, str] | None = None,columns: DeltaStructType | None = None,comment: str | None = None,commit: DeltaApiCommit | None = None,uniform: DeltaUniformMetadata | None = None,latest_published_version: SupportsIndex | None = None,protocol: DeltaProtocol | None = None,domains: SupportsGetItem[int, str] | None = None,partition_columns: SupportsGetItem[int, str] | None = None,last_commit_version: SupportsIndex | None = None,last_commit_timestamp_ms: SupportsIndex | None = None,)

One update action. The action says which fields are set: - set-properties: updates, property names to string values. - remove-properties: removals. - set-columns: columns. - set-table-comment: comment. - add-commit: commit and uniform. - set-latest-backfilled-version: latest_published_version. - set-protocol: protocol. - set-domain-metadata: updates, domain names to their metadata: delta.clustering to {"clusteringColumns": [["a"], ["b", "c"]]}, delta.rowTracking to {"rowIdHighWaterMark": 9}. - remove-domain-metadata: domains. - set-partition-columns: partition_columns. - update-metadata-snapshot-version: last_commit_version and last_commit_timestamp_ms.

Attributes

  • action (str) – Kind of the update: one of the actions above.
  • columns (DeltaStructType | None) – For set-columns: the new columns of the table.
  • comment (str | None) – For set-table-comment: the new comment of the table.
  • commit (DeltaApiCommit | None) – For add-commit: the commit to add.
  • domains (list[str]) – For remove-domain-metadata: the domain names to remove.
  • last_commit_timestamp_ms (int | None) – For update-metadata-snapshot-version: timestamp of the last commit, in epoch milliseconds (delta.lastCommitTimestamp).
  • last_commit_version (int | None) – For update-metadata-snapshot-version: version of the last commit (delta.lastUpdateVersion).
  • latest_published_version (int | None) – For set-latest-backfilled-version: the commits up to this version are backfilled.
  • partition_columns (list[str]) – For set-partition-columns: names of the partition columns. An empty list is sent too: it removes the partitioning.
  • protocol (DeltaProtocol | None) – For set-protocol: the new protocol. It replaces the protocol of the table.
  • removals (list[str]) – For remove-properties: the property keys to remove.
  • uniform (DeltaUniformMetadata | None) – For add-commit: UniForm metadata to commit with the commit.
  • updates (dict[str, Any]) – For set-properties: property names to string values. For set-domain-metadata: domain names to their metadata objects.

class unitycatalog.delta.DeltaUniform(*, iceberg: DeltaUniformIceberg | None = None)

UniForm metadata committed with a Delta commit.

Attributes

class unitycatalog.delta.DeltaUniformIceberg(*,metadata_location: str | None = None,converted_delta_version: SupportsIndex | None = None,converted_delta_timestamp: str | None = None,base_converted_delta_version: SupportsIndex | None = None,)

The Iceberg metadata of a UniForm table.

Attributes

  • base_converted_delta_version (int | None) – The Delta version of the Iceberg metadata that the conversion started from.
  • converted_delta_timestamp (str | None) – When the Delta version was converted, as an ISO-8601 instant in UTC.
  • converted_delta_version (int | None) – The Delta version that the Iceberg metadata was converted from.
  • metadata_location (str | None) – URL of the Iceberg metadata file. It must be inside the table.

class unitycatalog.delta.DeltaUniformMetadata(*, iceberg: DeltaUniformMetadataIceberg | None = None)

UniForm conversion metadata. Only UniForm (Delta and Iceberg) tables have it.

Attributes

class unitycatalog.delta.DeltaUniformMetadataIceberg(*,metadata_location: str | None = None,converted_delta_version: SupportsIndex | None = None,converted_delta_timestamp: SupportsIndex | None = None,base_converted_delta_version: SupportsIndex | None = None,)

The Iceberg metadata of a UniForm table.

Attributes

  • base_converted_delta_version (int | None) – The Delta version that the incremental conversion started from.
  • converted_delta_timestamp (int | None) – When the Delta version was converted, in epoch milliseconds.
  • converted_delta_version (int | None) – The Delta version that was converted to Iceberg.
  • metadata_location (str | None) – URL of the Iceberg metadata file.

class unitycatalog.delta.DeltaCredentialOperation

The access level of a storage credential.

Members

  • READ – Read the data.
  • READ_WRITE – Read and write the data.

class unitycatalog.delta.DeltaMaintenanceOperation

A maintenance operation that the catalog allows on a table, in addition to the operations that the Delta protocol allows.

Members

  • DATA_REORGANIZATION – Rewrite the data files of the latest version to group, cluster or lay out the data, without a change to the data.
  • DATA_CLEANUP – Delete old data files, without a change to the data of the latest version.
  • METADATA_CLEANUP – Delete old metadata files, without a change to the data of the latest version.

class unitycatalog.delta.DeltaTableType

The type of a Delta table.

Members

  • MANAGED – A table whose data Unity Catalog manages.
  • EXTERNAL – A table whose data is at a storage location that the user gives.