system_schemas
Creates, updates, deletes, gets or lists a system_schemas resource.
Overview
| Name | system_schemas |
| Type | Resource |
| Id | databricks_workspace.catalog.system_schemas |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
schema | string | |
state | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | metastore_id, deployment_name | max_results, page_token | Gets an array of system schemas for a metastore. The caller must be an account admin or a metastore |
enable | replace | metastore_id, schema_name, deployment_name | Enables the system schema and adds it to the system catalog. The caller must be an account admin or a | |
disable | delete | metastore_id, schema_name, deployment_name | Disables 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.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
metastore_id | string | The metastore ID under which the system schema lives. |
schema_name | string | Full name of the system schema. |
max_results | integer | Maximum 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_token | string | Opaque pagination token to go to next page based on previous query. |
SELECT examples
- list
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
- enable
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
- disable
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
;