Skip to main content

models

Operations on a models resource.

Overview

Namemodels
TypeResource
Iddatabricks_workspace.machinelearning.models

Fields

NameDatatype
namestring
descriptionstring
creation_timestampinteger
last_updated_timestampinteger
latest_versionsarray
tagsarray
user_idstring

Methods

NameAccessible byRequired ParamsDescription
getmodelSELECTname, deployment_nameGet the details of a model. This is a Databricks workspace version of the
listmodelsSELECTdeployment_nameLists all available registered models, up to the limit specified in
searchmodelsSELECTdeployment_nameSearch for registered models based on the specified
createmodelINSERTdeployment_nameCreates a new registered model with the name specified in the request body.
deletemodelDELETEname, deployment_nameDeletes a registered model.
updatemodelUPDATEdeployment_nameUpdates a registered model.
renamemodelEXECdeployment_nameRenames a registered model.

SELECT examples

SELECT
name,
description,
creation_timestamp,
last_updated_timestamp,
latest_versions,
tags,
user_id
FROM databricks_workspace.machinelearning.models
WHERE deployment_name = '{{ deployment_name }}';

INSERT example

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

/*+ create */
INSERT INTO databricks_workspace.machinelearning.models (
deployment_name,
data__name,
data__tags,
data__description
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ tags }}',
'{{ description }}'
;

UPDATE example

Updates a models resource.

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

DELETE example

Deletes a models resource.

/*+ delete */
DELETE FROM databricks_workspace.machinelearning.models
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';