model_versions
Operations on a model_versions
resource.
Overview
Name | model_versions |
Type | Resource |
Id | databricks_workspace.unitycatalog.model_versions |
Fields
Name | Datatype |
---|---|
id | string |
catalog_name | string |
comment | string |
created_at | integer |
created_by | string |
metastore_id | string |
model_name | string |
run_id | string |
run_workspace_id | string |
schema_name | string |
source | string |
status | string |
storage_location | string |
updated_at | integer |
updated_by | string |
version | integer |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | full_name, version, deployment_name | Get a model version. |
getbyalias | SELECT | alias, full_name, deployment_name | Get a model version by alias. |
list | SELECT | full_name, deployment_name | List model versions. You can list model versions under a particular schema, or list all model versions in the current metastore. |
delete | DELETE | full_name, version, deployment_name | Deletes a model version from the specified registered model. Any aliases assigned to the model version will also be deleted. |
update | UPDATE | full_name, version, deployment_name | Updates the specified model version. |
SELECT
examples
- model_versions (list)
- model_versions (get)
- model_versions (getbyalias)
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 }}';
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
version = '{{ version }}' AND
deployment_name = '{{ deployment_name }}';
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 alias = '{{ alias }}' AND
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 }}';