model_versions
Operations on a model_versions
resource.
Overview
Name | model_versions |
Type | Resource |
Id | databricks_workspace.machinelearning.model_versions |
Fields
Name | Datatype |
---|---|
name | string |
description | string |
creation_timestamp | integer |
current_stage | string |
last_updated_timestamp | integer |
run_id | string |
run_link | string |
source | string |
status | string |
status_message | string |
tags | array |
user_id | string |
version | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
getmodelversion | SELECT | name, version, deployment_name | Get a model version. |
searchmodelversions | SELECT | deployment_name | Searches for specific model versions based on the supplied |
createmodelversion | INSERT | deployment_name | Creates a model version. |
deletemodelversion | DELETE | name, version, deployment_name | Deletes a model version. |
updatemodelversion | UPDATE | deployment_name | Updates the model version. |
SELECT
examples
- model_versions (searchmodelversions)
- model_versions (getmodelversion)
SELECT
name,
description,
creation_timestamp,
current_stage,
last_updated_timestamp,
run_id,
run_link,
source,
status,
status_message,
tags,
user_id,
version
FROM databricks_workspace.machinelearning.model_versions
WHERE deployment_name = '{{ deployment_name }}';
SELECT
name,
description,
creation_timestamp,
current_stage,
last_updated_timestamp,
run_id,
run_link,
source,
status,
status_message,
tags,
user_id,
version
FROM databricks_workspace.machinelearning.model_versions
WHERE name = '{{ name }}' AND
version = '{{ version }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new model_versions
resource.
- model_versions
- Manifest
/*+ create */
INSERT INTO databricks_workspace.machinelearning.model_versions (
deployment_name,
data__name,
data__source,
data__run_id,
data__tags,
data__run_link,
data__description
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ source }}',
'{{ run_id }}',
'{{ tags }}',
'{{ run_link }}',
'{{ description }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: source
value: string
- name: run_id
value: string
- name: tags
value:
- key: string
value: string
- name: run_link
value: string
- name: description
value: string
UPDATE
example
Updates a model_versions
resource.
/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.machinelearning.model_versions
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE deployment_name = '{{ deployment_name }}';
DELETE
example
Deletes a model_versions
resource.
/*+ delete */
DELETE FROM databricks_workspace.machinelearning.model_versions
WHERE name = '{{ name }}' AND
version = '{{ version }}' AND
deployment_name = '{{ deployment_name }}';