lakeview
Creates, updates, deletes, gets or lists a lakeview resource.
Overview
| Name | lakeview |
| Type | Resource |
| Id | databricks_workspace.dashboards.lakeview |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
dashboard_id | string | UUID identifying the dashboard. |
warehouse_id | string | The warehouse ID used to run the dashboard. |
display_name | string | The display name of the dashboard. |
create_time | string | |
etag | string | The etag for the dashboard. Can be optionally provided on updates to ensure that the dashboard has not been modified since the last read. This field is excluded in List Dashboards responses. |
lifecycle_state | string | The state of the dashboard resource. Used for tracking trashed status. (ACTIVE, TRASHED) |
parent_path | string | The workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. This field is excluded in List Dashboards responses. |
path | string | The workspace path of the dashboard asset, including the file name. Exported dashboards always have the file extension `.lvdash.json`. This field is excluded in List Dashboards responses. |
serialized_dashboard | string | The contents of the dashboard in serialized string form. This field is excluded in List Dashboards responses. Use the [get dashboard API] to retrieve an example response, which includes the `serialized_dashboard` field. This field provides the structure of the JSON string that represents the dashboard's layout and components. [get dashboard API]: https://docs.databricks.com/api/workspace/lakeview/get |
update_time | string | The timestamp of when the dashboard was last updated by the user. This field is excluded in List Dashboards responses. |
| Name | Datatype | Description |
|---|---|---|
dashboard_id | string | UUID identifying the dashboard. |
warehouse_id | string | The warehouse ID used to run the dashboard. |
display_name | string | The display name of the dashboard. |
create_time | string | |
etag | string | The etag for the dashboard. Can be optionally provided on updates to ensure that the dashboard has not been modified since the last read. This field is excluded in List Dashboards responses. |
lifecycle_state | string | The state of the dashboard resource. Used for tracking trashed status. (ACTIVE, TRASHED) |
parent_path | string | The workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. This field is excluded in List Dashboards responses. |
path | string | The workspace path of the dashboard asset, including the file name. Exported dashboards always have the file extension `.lvdash.json`. This field is excluded in List Dashboards responses. |
serialized_dashboard | string | The contents of the dashboard in serialized string form. This field is excluded in List Dashboards responses. Use the [get dashboard API] to retrieve an example response, which includes the `serialized_dashboard` field. This field provides the structure of the JSON string that represents the dashboard's layout and components. [get dashboard API]: https://docs.databricks.com/api/workspace/lakeview/get |
update_time | string | The timestamp of when the dashboard was last updated by the user. This field is excluded in List Dashboards responses. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | dashboard_id, deployment_name | Get a draft dashboard. | |
list | select | deployment_name | page_size, page_token, show_trashed, view | List dashboards. |
create | insert | deployment_name, dashboard | dataset_catalog, dataset_schema | Create a draft dashboard. |
update | update | dashboard_id, deployment_name, dashboard | dataset_catalog, dataset_schema | Update a draft dashboard. |
update | replace | dashboard_id, deployment_name, dashboard | dataset_catalog, dataset_schema | Update a draft dashboard. |
delete | delete | dashboard_id, deployment_name | Trash a dashboard. | |
migrate | exec | deployment_name, source_dashboard_id | Migrates a classic SQL dashboard to Lakeview. |
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 |
|---|---|---|
dashboard_id | string | UUID identifying the dashboard. |
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
dataset_catalog | string | |
dataset_schema | string | Sets the default schema for all datasets in this dashboard. Does not impact table references that use fully qualified schema names (ex: nyctaxi.trips). Leave blank to keep each dataset’s existing configuration. |
page_size | integer | The number of dashboards to return per page. |
page_token | string | A page token, received from a previous ListDashboards call. This token can be used to retrieve the subsequent page. |
show_trashed | boolean | The flag to include dashboards located in the trash. If unspecified, only active dashboards will be returned. |
view | string | DASHBOARD_VIEW_BASIConly includes summary metadata from the dashboard. |
SELECT examples
- get
- list
Get a draft dashboard.
SELECT
dashboard_id,
warehouse_id,
display_name,
create_time,
etag,
lifecycle_state,
parent_path,
path,
serialized_dashboard,
update_time
FROM databricks_workspace.dashboards.lakeview
WHERE dashboard_id = '{{ dashboard_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
List dashboards.
SELECT
dashboard_id,
warehouse_id,
display_name,
create_time,
etag,
lifecycle_state,
parent_path,
path,
serialized_dashboard,
update_time
FROM databricks_workspace.dashboards.lakeview
WHERE deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
AND show_trashed = '{{ show_trashed }}'
AND view = '{{ view }}'
;
INSERT examples
- create
- Manifest
Create a draft dashboard.
INSERT INTO databricks_workspace.dashboards.lakeview (
dashboard,
deployment_name,
dataset_catalog,
dataset_schema
)
SELECT
'{{ dashboard }}' /* required */,
'{{ deployment_name }}',
'{{ dataset_catalog }}',
'{{ dataset_schema }}'
RETURNING
dashboard_id,
warehouse_id,
display_name,
create_time,
etag,
lifecycle_state,
parent_path,
path,
serialized_dashboard,
update_time
;
# Description fields are for documentation purposes
- name: lakeview
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the lakeview resource.
- name: dashboard
description: |
:param dataset_catalog: str (optional) Sets the default catalog for all datasets in this dashboard. Does not impact table references that use fully qualified catalog names (ex: samples.nyctaxi.trips). Leave blank to keep each dataset’s existing configuration.
value:
create_time: "{{ create_time }}"
dashboard_id: "{{ dashboard_id }}"
display_name: "{{ display_name }}"
etag: "{{ etag }}"
lifecycle_state: "{{ lifecycle_state }}"
parent_path: "{{ parent_path }}"
path: "{{ path }}"
serialized_dashboard: "{{ serialized_dashboard }}"
update_time: "{{ update_time }}"
warehouse_id: "{{ warehouse_id }}"
- name: dataset_catalog
value: "{{ dataset_catalog }}"
- name: dataset_schema
value: "{{ dataset_schema }}"
description: Sets the default schema for all datasets in this dashboard. Does not impact table references that use fully qualified schema names (ex: nyctaxi.trips). Leave blank to keep each dataset’s existing configuration.
UPDATE examples
- update
Update a draft dashboard.
UPDATE databricks_workspace.dashboards.lakeview
SET
dashboard = '{{ dashboard }}'
WHERE
dashboard_id = '{{ dashboard_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND dashboard = '{{ dashboard }}' --required
AND dataset_catalog = '{{ dataset_catalog}}'
AND dataset_schema = '{{ dataset_schema}}'
RETURNING
dashboard_id,
warehouse_id,
display_name,
create_time,
etag,
lifecycle_state,
parent_path,
path,
serialized_dashboard,
update_time;
REPLACE examples
- update
Update a draft dashboard.
REPLACE databricks_workspace.dashboards.lakeview
SET
dashboard = '{{ dashboard }}'
WHERE
dashboard_id = '{{ dashboard_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND dashboard = '{{ dashboard }}' --required
AND dataset_catalog = '{{ dataset_catalog}}'
AND dataset_schema = '{{ dataset_schema}}'
RETURNING
dashboard_id,
warehouse_id,
display_name,
create_time,
etag,
lifecycle_state,
parent_path,
path,
serialized_dashboard,
update_time;
DELETE examples
- delete
Trash a dashboard.
DELETE FROM databricks_workspace.dashboards.lakeview
WHERE dashboard_id = '{{ dashboard_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;
Lifecycle Methods
- migrate
Migrates a classic SQL dashboard to Lakeview.
EXEC databricks_workspace.dashboards.lakeview.migrate
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"source_dashboard_id": "{{ source_dashboard_id }}",
"display_name": "{{ display_name }}",
"parent_path": "{{ parent_path }}",
"update_parameter_syntax": {{ update_parameter_syntax }}
}'
;