query_visualizations
Creates, updates, deletes, gets or lists a query_visualizations resource.
Overview
| Name | query_visualizations |
| Type | Resource |
| Id | databricks_workspace.sql.query_visualizations |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
id | string | UUID identifying the visualization. |
query_id | string | UUID of the query that the visualization is attached to. |
display_name | string | The display name of the visualization. |
create_time | string | |
serialized_options | string | The visualization options varies widely from one visualization type to the next and is unsupported. Databricks does not recommend modifying visualization options directly. |
serialized_query_plan | string | The visualization query plan varies widely from one visualization type to the next and is unsupported. Databricks does not recommend modifying the visualization query plan directly. |
type | string | The type of visualization: counter, table, funnel, and so on. |
update_time | string | The timestamp indicating when the visualization was updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | id, deployment_name | page_size, page_token | Gets a list of visualizations on a query. |
create | insert | deployment_name | Adds a visualization to a query. | |
update | update | id, deployment_name, update_mask | Updates a visualization. | |
delete | delete | id, deployment_name | Removes a visualization. |
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) |
id | string | str |
page_size | integer | |
page_token | string | :returns: Iterator over :class:Visualization |
SELECT examples
- list
Gets a list of visualizations on a query.
SELECT
id,
query_id,
display_name,
create_time,
serialized_options,
serialized_query_plan,
type,
update_time
FROM databricks_workspace.sql.query_visualizations
WHERE id = '{{ id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- create
- Manifest
Adds a visualization to a query.
INSERT INTO databricks_workspace.sql.query_visualizations (
visualization,
deployment_name
)
SELECT
'{{ visualization }}',
'{{ deployment_name }}'
RETURNING
id,
query_id,
display_name,
create_time,
serialized_options,
serialized_query_plan,
type,
update_time
;
# Description fields are for documentation purposes
- name: query_visualizations
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the query_visualizations resource.
- name: visualization
description: |
:returns: :class:`Visualization`
value:
display_name: "{{ display_name }}"
query_id: "{{ query_id }}"
serialized_options: "{{ serialized_options }}"
serialized_query_plan: "{{ serialized_query_plan }}"
type: "{{ type }}"
UPDATE examples
- update
Updates a visualization.
UPDATE databricks_workspace.sql.query_visualizations
SET
update_mask = '{{ update_mask }}',
visualization = '{{ visualization }}'
WHERE
id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND update_mask = '{{ update_mask }}' --required
RETURNING
id,
query_id,
display_name,
create_time,
serialized_options,
serialized_query_plan,
type,
update_time;
DELETE examples
- delete
Removes a visualization.
DELETE FROM databricks_workspace.sql.query_visualizations
WHERE id = '{{ id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;