assets
Operations on a assets
resource.
Overview
Name | assets |
Type | Resource |
Id | databricks_workspace.cleanrooms.assets |
Fields
Name | Datatype |
---|---|
name | string |
added_at | integer |
asset_type | string |
foreign_table | object |
foreign_table_local_details | object |
notebook | object |
owner_collaborator_alias | string |
status | string |
table | object |
table_local_details | object |
view | object |
view_local_details | object |
volume_local_details | object |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
list | SELECT | clean_room_name, deployment_name | |
create | INSERT | clean_room_name, deployment_name | Create 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. |
delete | DELETE | asset_full_name, asset_type, clean_room_name, deployment_name | Delete a clean room asset - unshare/remove the asset from the clean room |
update | UPDATE | asset_type, clean_room_name, name, deployment_name | Update 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.
- assets
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: name
value: creator.sales.products
- name: asset_type
value: TABLE
- name: table_local_details
value:
local_name: demo.sales.products
partitions:
- values:
- name: string
value: string
recipient_property_key: string
op: EQUAL
- name: volume_local_details
value:
local_name: demo.sales.products
- name: view_local_details
value:
local_name: demo.sales.products
- name: foreign_table_local_details
value:
local_name: demo.sales.products
- name: table
value:
columns:
- name: string
type_text: string
type_name: BOOLEAN
position: 0
type_precision: 0
type_scale: 0
type_interval_type: string
type_json: string
comment: string
nullable: true
partition_index: 0
mask:
function_name: string
using_column_names:
- string
- name: notebook
value:
notebook_content: string
etag: string
- name: view
value:
columns:
- name: string
type_text: string
type_name: BOOLEAN
position: 0
type_precision: 0
type_scale: 0
type_interval_type: string
type_json: string
comment: string
nullable: true
partition_index: 0
mask:
function_name: string
using_column_names:
- string
- name: foreign_table
value:
columns:
- name: string
type_text: string
type_name: BOOLEAN
position: 0
type_precision: 0
type_scale: 0
type_interval_type: string
type_json: string
comment: string
nullable: true
partition_index: 0
mask:
function_name: string
using_column_names:
- string
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 }}';