Skip to main content

model_versions

Operations on a model_versions resource.

Overview

Namemodel_versions
TypeResource
Iddatabricks_workspace.unitycatalog.model_versions

Fields

NameDatatype
idstring
catalog_namestring
commentstring
created_atinteger
created_bystring
metastore_idstring
model_namestring
run_idstring
run_workspace_idstring
schema_namestring
sourcestring
statusstring
storage_locationstring
updated_atinteger
updated_bystring
versioninteger

Methods

NameAccessible byRequired ParamsDescription
getSELECTfull_name, version, deployment_nameGet a model version.
getbyaliasSELECTalias, full_name, deployment_nameGet a model version by alias.
listSELECTfull_name, deployment_nameList model versions. You can list model versions under a particular schema, or list all model versions in the current metastore.
deleteDELETEfull_name, version, deployment_nameDeletes a model version from the specified registered model. Any aliases assigned to the model version will also be deleted.
updateUPDATEfull_name, version, deployment_nameUpdates the specified model version.

SELECT examples

SELECT
id,
catalog_name,
comment,
created_at,
created_by,
metastore_id,
model_name,
run_id,
run_workspace_id,
schema_name,
source,
status,
storage_location,
updated_at,
updated_by,
version
FROM databricks_workspace.unitycatalog.model_versions
WHERE full_name = '{{ full_name }}' AND
deployment_name = '{{ deployment_name }}';

UPDATE example

Updates a model_versions resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.unitycatalog.model_versions
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE full_name = '{{ full_name }}' AND
version = '{{ version }}' AND
deployment_name = '{{ deployment_name }}';

DELETE example

Deletes a model_versions resource.

/*+ delete */
DELETE FROM databricks_workspace.unitycatalog.model_versions
WHERE full_name = '{{ full_name }}' AND
version = '{{ version }}' AND
deployment_name = '{{ deployment_name }}';