Skip to main content

statement_execution

Creates, updates, deletes, gets or lists a statement_execution resource.

Overview

Namestatement_execution
TypeResource
Iddatabricks_workspace.dbsql.statement_execution

Fields

The following fields are returned by SELECT queries:

StatementResponse contains statement_id and status; other fields might be absent or present depending on context. In case of an error during execution of the SQL statement -- as opposed to an error while processing the request -- a 200 response is returned with error details in the status field.

NameDatatypeDescription
statement_idstring
manifestobject
resultobject
statusobject

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getstatementselectdeployment_nameThis request can be used to poll for the statement's status. When the
cancelexecutionexecdeployment_nameRequests that an executing statement be canceled. Callers must poll for status to see the terminal state.
executestatementexecdeployment_nameExecute a SQL statement and optionally await its results for a specified time.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)

SELECT examples

This request can be used to poll for the statement's status. When the

SELECT
statement_id,
manifest,
result,
status
FROM databricks_workspace.dbsql.statement_execution
WHERE deployment_name = '{{ deployment_name }}' -- required;

Lifecycle Methods

Requests that an executing statement be canceled. Callers must poll for status to see the terminal state.

EXEC databricks_workspace.dbsql.statement_execution.cancelexecution 
@deployment_name='{{ deployment_name }}' --required;