Skip to main content

clean_rooms

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

Overview

Nameclean_rooms
TypeResource
Iddatabricks_workspace.cleanrooms.clean_rooms

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the clean room. It should follow [UC securable naming requirements]. [UC securable naming requirements]: https://docs.databricks.com/en/data-governance/unity-catalog/index.html#securable-object-naming-requirements
access_restrictedstringCreate a collection of name/value pairs.<br /><br />Example enumeration:<br /><br />&gt;&gt;&gt; class Color(Enum):<br />... RED = 1<br />... BLUE = 2<br />... GREEN = 3<br /><br />Access them by:<br /><br />- attribute access:<br /><br /> &gt;&gt;&gt; Color.RED<br /> &lt;Color.RED: 1&gt;<br /><br />- value lookup:<br /><br /> &gt;&gt;&gt; Color(1)<br /> &lt;Color.RED: 1&gt;<br /><br />- name lookup:<br /><br /> &gt;&gt;&gt; Color['RED']<br /> &lt;Color.RED: 1&gt;<br /><br />Enumerations can be iterated over, and know how many members they have:<br /><br />&gt;&gt;&gt; len(Color)<br />3<br /><br />&gt;&gt;&gt; list(Color)<br />[&lt;Color.RED: 1&gt;, &lt;Color.BLUE: 2&gt;, &lt;Color.GREEN: 3&gt;]<br /><br />Methods can be added to enumerations, and members can have their own<br />attributes -- see the documentation for details. (CSP_MISMATCH, NO_RESTRICTION)
commentstring
created_atintegerWhen the clean room was created, in epoch milliseconds.
local_collaborator_aliasstringThe alias of the collaborator tied to the local clean room.
output_catalogobjectOutput catalog of the clean room. It is an output only field. Output catalog is manipulated using the separate CreateCleanRoomOutputCatalog API.
ownerstringThis is the Databricks username of the owner of the local clean room securable for permission management.
remote_detailed_infoobjectCentral clean room details. During creation, users need to specify cloud_vendor, region, and collaborators.global_metastore_id. This field will not be filled in the ListCleanRooms call.
statusstringClean room status. (ACTIVE, DELETED, FAILED, PROVISIONING)
updated_atintegerWhen the clean room was last updated, in epoch milliseconds.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectname, deployment_nameGet the details of a clean room given its name.
listselectdeployment_namepage_size, page_tokenGet a list of all clean rooms of the metastore. Only clean rooms the caller has access to are
createinsertdeployment_name, clean_roomCreate a new clean room with the specified collaborators. This method is asynchronous; the returned
updateupdatename, deployment_nameUpdate a clean room. The caller must be the owner of the clean room, have MODIFY_CLEAN_ROOM
deletedeletename, deployment_nameDelete a clean room. After deletion, the clean room will be removed from the metastore. If the other
create_output_catalogexecclean_room_name, deployment_name, output_catalogCreate the output catalog of the clean room.

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
clean_room_namestringName of the clean room.
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
namestringName of the clean room.
page_sizeintegerMaximum number of clean rooms to return (i.e., the page length). Defaults to 100.
page_tokenstringOpaque pagination token to go to next page based on previous query.

SELECT examples

Get the details of a clean room given its name.

SELECT
name,
access_restricted,
comment,
created_at,
local_collaborator_alias,
output_catalog,
owner,
remote_detailed_info,
status,
updated_at
FROM databricks_workspace.cleanrooms.clean_rooms
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Create a new clean room with the specified collaborators. This method is asynchronous; the returned

INSERT INTO databricks_workspace.cleanrooms.clean_rooms (
clean_room,
deployment_name
)
SELECT
'{{ clean_room }}' /* required */,
'{{ deployment_name }}'
RETURNING
name,
access_restricted,
comment,
created_at,
local_collaborator_alias,
output_catalog,
owner,
remote_detailed_info,
status,
updated_at
;

UPDATE examples

Update a clean room. The caller must be the owner of the clean room, have MODIFY_CLEAN_ROOM

UPDATE databricks_workspace.cleanrooms.clean_rooms
SET
clean_room = '{{ clean_room }}'
WHERE
name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
RETURNING
name,
access_restricted,
comment,
created_at,
local_collaborator_alias,
output_catalog,
owner,
remote_detailed_info,
status,
updated_at;

DELETE examples

Delete a clean room. After deletion, the clean room will be removed from the metastore. If the other

DELETE FROM databricks_workspace.cleanrooms.clean_rooms
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;

Lifecycle Methods

Create the output catalog of the clean room.

EXEC databricks_workspace.cleanrooms.clean_rooms.create_output_catalog 
@clean_room_name='{{ clean_room_name }}' --required,
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"output_catalog": "{{ output_catalog }}"
}'
;