Skip to main content

commands

Operations on a commands resource.

Overview

Namecommands
TypeResource
Iddatabricks_workspace.compute.commands

Fields

NameDatatype
idstring
resultsobject
statusstring

Methods

NameAccessible byRequired ParamsDescription
commandstatusSELECTclusterId, commandId, contextId, deployment_nameGets the status of and, if available, the results from a currently executing command.
createINSERTdeployment_nameCreates an execution context for running cluster commands.
cancelEXECdeployment_nameCancels a currently running command within an execution context.
destroyEXECdeployment_nameDeletes an execution context.
executeEXECdeployment_nameRuns a cluster command in the given execution context, using the provided language.

SELECT examples

SELECT
id,
results,
status
FROM databricks_workspace.compute.commands
WHERE clusterId = '{{ clusterId }}' AND
commandId = '{{ commandId }}' AND
contextId = '{{ contextId }}' AND
deployment_name = '{{ deployment_name }}';

INSERT example

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

/*+ create */
INSERT INTO databricks_workspace.compute.commands (
deployment_name,
data__clusterId,
data__language
)
SELECT
'{{ deployment_name }}',
'{{ clusterId }}',
'{{ language }}'
;