Skip to main content

model_versions

Operations on a model_versions resource.

Overview

Namemodel_versions
TypeResource
Iddatabricks_workspace.machinelearning.model_versions

Fields

NameDatatype
namestring
descriptionstring
creation_timestampinteger
current_stagestring
last_updated_timestampinteger
run_idstring
run_linkstring
sourcestring
statusstring
status_messagestring
tagsarray
user_idstring
versionstring

Methods

NameAccessible byRequired ParamsDescription
getmodelversionSELECTname, version, deployment_nameGet a model version.
searchmodelversionsSELECTdeployment_nameSearches for specific model versions based on the supplied
createmodelversionINSERTdeployment_nameCreates a model version.
deletemodelversionDELETEname, version, deployment_nameDeletes a model version.
updatemodelversionUPDATEdeployment_nameUpdates the model version.

SELECT examples

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new model_versions resource.

/*+ 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 }}'
;

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 }}';