Skip to main content

lakeview

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

Overview

Namelakeview
TypeResource
Iddatabricks_workspace.dashboards.lakeview

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
dashboard_idstringUUID identifying the dashboard.
warehouse_idstringThe warehouse ID used to run the dashboard.
display_namestringThe display name of the dashboard.
create_timestring
etagstringThe 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_statestringThe state of the dashboard resource. Used for tracking trashed status. (ACTIVE, TRASHED)
parent_pathstringThe workspace path of the folder containing the dashboard. Includes leading slash and no trailing slash. This field is excluded in List Dashboards responses.
pathstringThe 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_dashboardstringThe 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_timestringThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdashboard_id, deployment_nameGet a draft dashboard.
listselectdeployment_namepage_size, page_token, show_trashed, viewList dashboards.
createinsertdeployment_name, dashboarddataset_catalog, dataset_schemaCreate a draft dashboard.
updateupdatedashboard_id, deployment_name, dashboarddataset_catalog, dataset_schemaUpdate a draft dashboard.
updatereplacedashboard_id, deployment_name, dashboarddataset_catalog, dataset_schemaUpdate a draft dashboard.
deletedeletedashboard_id, deployment_nameTrash a dashboard.
migrateexecdeployment_name, source_dashboard_idMigrates 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.

NameDatatypeDescription
dashboard_idstringUUID identifying the dashboard.
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
dataset_catalogstring
dataset_schemastringSets 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_sizeintegerThe number of dashboards to return per page.
page_tokenstringA page token, received from a previous ListDashboards call. This token can be used to retrieve the subsequent page.
show_trashedbooleanThe flag to include dashboards located in the trash. If unspecified, only active dashboards will be returned.
viewstringDASHBOARD_VIEW_BASIConly includes summary metadata from the dashboard.

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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 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

Trash a dashboard.

DELETE FROM databricks_workspace.dashboards.lakeview
WHERE dashboard_id = '{{ dashboard_id }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;

Lifecycle Methods

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 }}
}'
;