Skip to main content

assets

Operations on a assets resource.

Overview

Nameassets
TypeResource
Iddatabricks_workspace.cleanrooms.assets

Fields

NameDatatype
namestring
added_atinteger
asset_typestring
foreign_tableobject
foreign_table_local_detailsobject
notebookobject
owner_collaborator_aliasstring
statusstring
tableobject
table_local_detailsobject
viewobject
view_local_detailsobject
volume_local_detailsobject

Methods

NameAccessible byRequired ParamsDescription
listSELECTclean_room_name, deployment_name
createINSERTclean_room_name, deployment_nameCreate a clean room asset —share an asset like a notebook or table into the clean room. For each UC asset that is added through this method, the clean room owner must also have enough privilege on the asset to consume it. The privilege must be maintained indefinitely for the clean room to be able to access the asset. Typically, you should use a group as the clean room owner.
deleteDELETEasset_full_name, asset_type, clean_room_name, deployment_nameDelete a clean room asset - unshare/remove the asset from the clean room
updateUPDATEasset_type, clean_room_name, name, deployment_nameUpdate a clean room asset. For example, updating the content of a notebook; changing the shared partitions of a table; etc.

SELECT examples

SELECT
name,
added_at,
asset_type,
foreign_table,
foreign_table_local_details,
notebook,
owner_collaborator_alias,
status,
table,
table_local_details,
view,
view_local_details,
volume_local_details
FROM databricks_workspace.cleanrooms.assets
WHERE clean_room_name = '{{ clean_room_name }}' AND
deployment_name = '{{ deployment_name }}';

INSERT example

Use the following StackQL query and manifest file to create a new assets resource.

/*+ create */
INSERT INTO databricks_workspace.cleanrooms.assets (
clean_room_name,
deployment_name,
data__name,
data__asset_type,
data__table_local_details,
data__volume_local_details,
data__view_local_details,
data__foreign_table_local_details,
data__table,
data__notebook,
data__view,
data__foreign_table
)
SELECT
'{{ clean_room_name }}',
'{{ deployment_name }}',
'{{ name }}',
'{{ asset_type }}',
'{{ table_local_details }}',
'{{ volume_local_details }}',
'{{ view_local_details }}',
'{{ foreign_table_local_details }}',
'{{ table }}',
'{{ notebook }}',
'{{ view }}',
'{{ foreign_table }}'
;

UPDATE example

Updates a assets resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.cleanrooms.assets
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE asset_type = '{{ asset_type }}' AND
clean_room_name = '{{ clean_room_name }}' AND
name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';

DELETE example

Deletes a assets resource.

/*+ delete */
DELETE FROM databricks_workspace.cleanrooms.assets
WHERE asset_full_name = '{{ asset_full_name }}' AND
asset_type = '{{ asset_type }}' AND
clean_room_name = '{{ clean_room_name }}' AND
deployment_name = '{{ deployment_name }}';