statement_execution
Creates, updates, deletes, gets or lists a statement_execution
resource.
Overview
Name | statement_execution |
Type | Resource |
Id | databricks_workspace.dbsql.statement_execution |
Fields
The following fields are returned by SELECT
queries:
- getstatement
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.
Name | Datatype | Description |
---|---|---|
statement_id | string | |
manifest | object | |
result | object | |
status | object |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
getstatement | select | deployment_name | This request can be used to poll for the statement's status. When the | |
cancelexecution | exec | deployment_name | Requests that an executing statement be canceled. Callers must poll for status to see the terminal state. | |
executestatement | exec | deployment_name | Execute 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.
Name | Datatype | Description |
---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
SELECT
examples
- getstatement
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
- cancelexecution
- executestatement
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;
Execute a SQL statement and optionally await its results for a specified time.
EXEC databricks_workspace.dbsql.statement_execution.executestatement
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"statement": "{{ statement }}",
"warehouse_id": "{{ warehouse_id }}",
"catalog": "{{ catalog }}",
"schema": "{{ schema }}",
"row_limit": "{{ row_limit }}",
"byte_limit": "{{ byte_limit }}",
"disposition": {{ disposition }},
"format": {{ format }},
"wait_timeout": "{{ wait_timeout }}",
"on_wait_timeout": "{{ on_wait_timeout }}",
"parameters": "{{ parameters }}"
}';