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 <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.
enable_shared_outputbooleanWhether allow task to write to shared output schema. When enabled, clean room task runs triggered by the current collaborator can write to the run-scoped shared output schema which is accessible by all collaborators.
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_name, workspace_domainGet the details of a clean room given its name.
listselectdeployment_name, workspace_domainpage_size, page_tokenGet a list of all clean rooms of the metastore. Only clean rooms the caller has access to are
createinsertdeployment_name, workspace_domainCreate a new clean room with the specified collaborators. This method is asynchronous; the returned
updateupdatename, deployment_name, workspace_domainUpdate a clean room. The caller must be the owner of the clean room, have MODIFY_CLEAN_ROOM
deletedeletename, deployment_name, workspace_domainDelete a clean room. After deletion, the clean room will be removed from the metastore. If the other
create_output_catalogexecclean_room_name, deployment_name, workspace_domainCreate 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: the host prefix of the workspace URL (dbc-abcd0123-a1bc on AWS, adb-1234567890123456.7 on Azure, 1234567890123456.7 on GCP). Set DATABRICKS_DEPLOYMENT_NAME to default it for the session. (default: dbc-abcd0123-a1bc, x-stackQL-envVar: DATABRICKS_DEPLOYMENT_NAME)
namestringName of the clean room.
workspace_domainstringThe Databricks workspace domain suffix for the cloud. Selected by DATABRICKS_CLOUD (aws, azure or gcp; default aws). (default: cloud.databricks.com, x-stackQL-envVarSelector: {"envVar":"DATABRICKS_CLOUD","default":"aws","values":{"aws":"cloud.databricks.com","azure":"azuredatabricks.net","gcp":"gcp.databricks.com"}})
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,
enable_shared_output,
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
AND workspace_domain = '{{ workspace_domain }}' -- 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 (
access_restricted,
comment,
created_at,
enable_shared_output,
local_collaborator_alias,
name,
output_catalog,
owner,
remote_detailed_info,
status,
updated_at,
deployment_name,
workspace_domain
)
SELECT
'{{ access_restricted }}',
'{{ comment }}',
{{ created_at }},
{{ enable_shared_output }},
'{{ local_collaborator_alias }}',
'{{ name }}',
'{{ output_catalog }}',
'{{ owner }}',
'{{ remote_detailed_info }}',
'{{ status }}',
{{ updated_at }},
'{{ deployment_name }}',
'{{ workspace_domain }}'
RETURNING
name,
access_restricted,
comment,
created_at,
enable_shared_output,
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
AND workspace_domain = '{{ workspace_domain }}' --required
RETURNING
name,
access_restricted,
comment,
created_at,
enable_shared_output,
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
AND workspace_domain = '{{ workspace_domain }}' --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,
@workspace_domain='{{ workspace_domain }}' --required
@@json=
'{
"catalog_name": "{{ catalog_name }}",
"status": "{{ status }}"
}'
;