Skip to main content

metastore_assignments

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

Overview

Namemetastore_assignments
TypeResource
Iddatabricks_account.unity_catalog.metastore_assignments

Fields

The following fields are returned by SELECT queries:

The workspace metastore assignment was successfully returned.

NameDatatypeDescription
metastore_idstring
workspace_idinteger
default_catalog_namestring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectGets the metastore assignment, if any, for the workspace specified by ID. If the workspace is assigned a metastore, the mappig will be returned. If no metastore is assigned to the workspace, the assignment will not be found and a 404 returned.
createinsertCreates an assignment to a metastore for a workspace
updatereplaceUpdates an assignment to a metastore for a workspace. Currently, only the default catalog may be updated.
deletedeleteDeletes a metastore assignment to a workspace, leaving the workspace with no metastore.

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

SELECT examples

Gets the metastore assignment, if any, for the workspace specified by ID. If the workspace is assigned a metastore, the mappig will be returned. If no metastore is assigned to the workspace, the assignment will not be found and a 404 returned.

SELECT
metastore_id,
workspace_id,
default_catalog_name
FROM databricks_account.unity_catalog.metastore_assignments;

INSERT examples

Creates an assignment to a metastore for a workspace

INSERT INTO databricks_account.unity_catalog.metastore_assignments (
data__metastore_assignment
)
SELECT
'{{ metastore_assignment }}'
;

REPLACE examples

Updates an assignment to a metastore for a workspace. Currently, only the default catalog may be updated.

REPLACE databricks_account.unity_catalog.metastore_assignments
SET
data__metastore_assignment = '{{ metastore_assignment }}'
WHERE
;

DELETE examples

Deletes a metastore assignment to a workspace, leaving the workspace with no metastore.

DELETE FROM databricks_account.unity_catalog.metastore_assignments;