Skip to main content

system_schemas

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

Overview

Namesystem_schemas
TypeResource
Iddatabricks_workspace.catalog.system_schemas

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
schemastring
statestringThe current state of enablement for the system schema. An empty string means the system schema is available and ready for opt-in. Possible values: AVAILABLE | ENABLE_INITIALIZED | ENABLE_COMPLETED | DISABLE_INITIALIZED | UNAVAILABLE | MANAGED

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectmetastore_id, deployment_namemax_results, page_tokenGets an array of system schemas for a metastore. The caller must be an account admin or a metastore
enablereplacemetastore_id, schema_name, deployment_nameEnables the system schema and adds it to the system catalog. The caller must be an account admin or a
disabledeletemetastore_id, schema_name, deployment_nameDisables the system schema and removes it from the system catalog. The caller must be an account admin

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)
metastore_idstringThe metastore ID under which the system schema lives.
schema_namestringFull name of the system schema.
max_resultsintegerMaximum number of schemas to return. - When set to 0, the page length is set to a server configured value (recommended); - When set to a value greater than 0, the page length is the minimum of this value and a server configured value; - When set to a value less than 0, an invalid parameter error is returned; - If not set, all the schemas are returned (not recommended).
page_tokenstringOpaque pagination token to go to next page based on previous query.

SELECT examples

Gets an array of system schemas for a metastore. The caller must be an account admin or a metastore

SELECT
schema,
state
FROM databricks_workspace.catalog.system_schemas
WHERE metastore_id = '{{ metastore_id }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND max_results = '{{ max_results }}'
AND page_token = '{{ page_token }}'
;

REPLACE examples

Enables the system schema and adds it to the system catalog. The caller must be an account admin or a

REPLACE databricks_workspace.catalog.system_schemas
SET
catalog_name = '{{ catalog_name }}'
WHERE
metastore_id = '{{ metastore_id }}' --required
AND schema_name = '{{ schema_name }}' --required
AND deployment_name = '{{ deployment_name }}' --required;

DELETE examples

Disables the system schema and removes it from the system catalog. The caller must be an account admin

DELETE FROM databricks_workspace.catalog.system_schemas
WHERE metastore_id = '{{ metastore_id }}' --required
AND schema_name = '{{ schema_name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;