schemas
Creates, updates, deletes, gets or lists a schemas
resource.
Overview
Name | schemas |
Type | Resource |
Id | databricks_workspace.unitycatalog.schemas |
Fields
The following fields are returned by SELECT
queries:
- get
- list
The schema was successfully retrieved.
Name | Datatype | Description |
---|---|---|
name | string | |
metastore_id | string | |
schema_id | string | |
catalog_name | string | |
full_name | string | |
browse_only | boolean | |
catalog_type | string | |
comment | string | |
created_at | integer | |
created_by | string | |
effective_predictive_optimization_flag | object | |
enable_predictive_optimization | string | |
owner | string | |
properties | object | |
storage_location | string | |
storage_root | string | |
updated_at | integer | |
updated_by | string |
The schemas list was successfully retrieved.
Name | Datatype | Description |
---|---|---|
name | string | |
metastore_id | string | |
schema_id | string | |
catalog_name | string | |
full_name | string | |
browse_only | boolean | |
catalog_type | string | |
comment | string | |
created_at | integer | |
created_by | string | |
effective_predictive_optimization_flag | object | |
enable_predictive_optimization | string | |
owner | string | |
properties | object | |
storage_location | string | |
storage_root | string | |
updated_at | integer | |
updated_by | string |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | deployment_name | Gets the specified schema within the metastore. The caller must be a metastore admin, the owner of the schema, or a user that has the | |
list | select | deployment_name | Gets an array of schemas for a catalog in the metastore. If the caller is the metastore admin or the owner of the parent catalog, all schemas for the catalog will be retrieved. Otherwise, only schemas owned by the caller (or for which the caller has the | |
create | insert | deployment_name | Creates a new schema for catalog in the Metatastore. The caller must be a metastore admin, or have the | |
update | update | deployment_name | Updates a schema for a catalog. The caller must be the owner of the schema or a metastore admin. If the caller is a metastore admin, only the | |
delete | delete | deployment_name | Deletes the specified schema from the parent catalog. The caller must be the owner of the schema or an owner of the parent catalog. |
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) |
SELECT
examples
- get
- list
Gets the specified schema within the metastore. The caller must be a metastore admin, the owner of the schema, or a user that has the
SELECT
name,
metastore_id,
schema_id,
catalog_name,
full_name,
browse_only,
catalog_type,
comment,
created_at,
created_by,
effective_predictive_optimization_flag,
enable_predictive_optimization,
owner,
properties,
storage_location,
storage_root,
updated_at,
updated_by
FROM databricks_workspace.unitycatalog.schemas
WHERE deployment_name = '{{ deployment_name }}' -- required;
Gets an array of schemas for a catalog in the metastore. If the caller is the metastore admin or the owner of the parent catalog, all schemas for the catalog will be retrieved. Otherwise, only schemas owned by the caller (or for which the caller has the
SELECT
name,
metastore_id,
schema_id,
catalog_name,
full_name,
browse_only,
catalog_type,
comment,
created_at,
created_by,
effective_predictive_optimization_flag,
enable_predictive_optimization,
owner,
properties,
storage_location,
storage_root,
updated_at,
updated_by
FROM databricks_workspace.unitycatalog.schemas
WHERE deployment_name = '{{ deployment_name }}' -- required;
INSERT
examples
- create
- Manifest
Creates a new schema for catalog in the Metatastore. The caller must be a metastore admin, or have the
INSERT INTO databricks_workspace.unitycatalog.schemas (
data__name,
data__catalog_name,
data__comment,
data__storage_root,
data__properties,
deployment_name
)
SELECT
'{{ name }}',
'{{ catalog_name }}',
'{{ comment }}',
'{{ storage_root }}',
'{{ properties }}',
'{{ deployment_name }}'
RETURNING
name,
metastore_id,
schema_id,
catalog_name,
full_name,
browse_only,
catalog_type,
comment,
created_at,
created_by,
effective_predictive_optimization_flag,
enable_predictive_optimization,
owner,
properties,
storage_location,
storage_root,
updated_at,
updated_by
;
# Description fields are for documentation purposes
- name: schemas
props:
- name: deployment_name
value: string
description: Required parameter for the schemas resource.
- name: name
value: required
- name: catalog_name
value: string
- name: comment
value: required
- name: storage_root
value: string
- name: properties
value: object
UPDATE
examples
- update
Updates a schema for a catalog. The caller must be the owner of the schema or a metastore admin. If the caller is a metastore admin, only the
UPDATE databricks_workspace.unitycatalog.schemas
SET
data__owner = '{{ owner }}',
data__comment = '{{ comment }}',
data__enable_predictive_optimization = '{{ enable_predictive_optimization }}',
data__new_name = '{{ new_name }}',
data__properties = '{{ properties }}'
WHERE
deployment_name = '{{ deployment_name }}' --required
RETURNING
name,
metastore_id,
schema_id,
catalog_name,
full_name,
browse_only,
catalog_type,
comment,
created_at,
created_by,
effective_predictive_optimization_flag,
enable_predictive_optimization,
owner,
properties,
storage_location,
storage_root,
updated_at,
updated_by;
DELETE
examples
- delete
Deletes the specified schema from the parent catalog. The caller must be the owner of the schema or an owner of the parent catalog.
DELETE FROM databricks_workspace.unitycatalog.schemas
WHERE deployment_name = '{{ deployment_name }}' --required;