Skip to main content

metastore_assignments

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

Overview

Namemetastore_assignments
TypeResource
Iddatabricks_workspace.unitycatalog.metastore_assignments

Fields

The following fields are returned by SELECT queries:

The metastore assignment was successfully retrieved.

NameDatatypeDescription
metastore_idstring
workspace_idinteger
default_catalog_namestring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
currentselectdeployment_nameGets the metastore assignment for the workspace being accessed.
assigninsertdeployment_nameCreates a new metastore assignment. If an assignment for the same
updateassignmentupdatedeployment_nameUpdates a metastore assignment. This operation can be used to update
unassigndeletedeployment_nameDeletes a metastore assignment. The caller must be an account administrator.

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
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)

SELECT examples

Gets the metastore assignment for the workspace being accessed.

SELECT
metastore_id,
workspace_id,
default_catalog_name
FROM databricks_workspace.unitycatalog.metastore_assignments
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Creates a new metastore assignment. If an assignment for the same

INSERT INTO databricks_workspace.unitycatalog.metastore_assignments (
data__metastore_id,
data__default_catalog_name,
deployment_name
)
SELECT
'{{ metastore_id }}',
'{{ default_catalog_name }}',
'{{ deployment_name }}'
;

UPDATE examples

Updates a metastore assignment. This operation can be used to update

UPDATE databricks_workspace.unitycatalog.metastore_assignments
SET
data__metastore_id = '{{ metastore_id }}',
data__default_catalog_name = '{{ default_catalog_name }}'
WHERE
deployment_name = '{{ deployment_name }}' --required;

DELETE examples

Deletes a metastore assignment. The caller must be an account administrator.

DELETE FROM databricks_workspace.unitycatalog.metastore_assignments
WHERE deployment_name = '{{ deployment_name }}' --required;