schemas
Creates, updates, deletes, gets or lists a schemas resource.
Overview
| Name | schemas |
| Type | Resource |
| Id | databricks_workspace.catalog.schemas |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Name of schema, relative to parent catalog. |
metastore_id | string | Unique identifier of parent metastore. |
schema_id | string | The unique identifier of the schema. |
catalog_name | string | Name of parent catalog. |
full_name | string | Full name of schema, in form of __catalog_name__.__schema_name__. |
browse_only | boolean | Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. |
catalog_type | string | The type of the catalog. (DELTASHARING_CATALOG, FOREIGN_CATALOG, INTERNAL_CATALOG, MANAGED_CATALOG, MANAGED_ONLINE_CATALOG, SYSTEM_CATALOG) |
comment | string | User-provided free-form text description. |
created_at | integer | Time at which this schema was created, in epoch milliseconds. |
created_by | string | Username of schema creator. |
effective_predictive_optimization_flag | object | |
enable_predictive_optimization | string | Create a collection of name/value pairs.<br /><br />Example enumeration:<br /><br />>>> class Color(Enum):<br />... RED = 1<br />... BLUE = 2<br />... GREEN = 3<br /><br />Access them by:<br /><br />- attribute access::<br /><br />>>> Color.RED<br /><Color.RED: 1><br /><br />- value lookup:<br /><br />>>> Color(1)<br /><Color.RED: 1><br /><br />- name lookup:<br /><br />>>> Color['RED']<br /><Color.RED: 1><br /><br />Enumerations can be iterated over, and know how many members they have:<br /><br />>>> len(Color)<br />3<br /><br />>>> list(Color)<br />[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]<br /><br />Methods can be added to enumerations, and members can have their own<br />attributes -- see the documentation for details. (DISABLE, ENABLE, INHERIT) |
owner | string | Username of current owner of schema. |
properties | object | A map of key-value properties attached to the securable. |
storage_location | string | Storage location for managed tables within schema. |
storage_root | string | Storage root URL for managed tables within schema. |
updated_at | integer | Time at which this schema was created, in epoch milliseconds. |
updated_by | string | Username of user who last modified schema. |
| Name | Datatype | Description |
|---|---|---|
name | string | Name of schema, relative to parent catalog. |
metastore_id | string | Unique identifier of parent metastore. |
schema_id | string | The unique identifier of the schema. |
catalog_name | string | Name of parent catalog. |
full_name | string | Full name of schema, in form of __catalog_name__.__schema_name__. |
browse_only | boolean | Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. |
catalog_type | string | The type of the catalog. (DELTASHARING_CATALOG, FOREIGN_CATALOG, INTERNAL_CATALOG, MANAGED_CATALOG, MANAGED_ONLINE_CATALOG, SYSTEM_CATALOG) |
comment | string | User-provided free-form text description. |
created_at | integer | Time at which this schema was created, in epoch milliseconds. |
created_by | string | Username of schema creator. |
effective_predictive_optimization_flag | object | |
enable_predictive_optimization | string | Create a collection of name/value pairs.<br /><br />Example enumeration:<br /><br />>>> class Color(Enum):<br />... RED = 1<br />... BLUE = 2<br />... GREEN = 3<br /><br />Access them by:<br /><br />- attribute access::<br /><br />>>> Color.RED<br /><Color.RED: 1><br /><br />- value lookup:<br /><br />>>> Color(1)<br /><Color.RED: 1><br /><br />- name lookup:<br /><br />>>> Color['RED']<br /><Color.RED: 1><br /><br />Enumerations can be iterated over, and know how many members they have:<br /><br />>>> len(Color)<br />3<br /><br />>>> list(Color)<br />[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]<br /><br />Methods can be added to enumerations, and members can have their own<br />attributes -- see the documentation for details. (DISABLE, ENABLE, INHERIT) |
owner | string | Username of current owner of schema. |
properties | object | A map of key-value properties attached to the securable. |
storage_location | string | Storage location for managed tables within schema. |
storage_root | string | Storage root URL for managed tables within schema. |
updated_at | integer | Time at which this schema was created, in epoch milliseconds. |
updated_by | string | Username of user who last modified schema. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | full_name, deployment_name | include_browse | Gets the specified schema within the metastore. The caller must be a metastore admin, the owner of the |
list | select | catalog_name, deployment_name | include_browse, max_results, page_token | Gets an array of schemas for a catalog in the metastore. If the caller is the metastore admin or the |
create | insert | deployment_name, name, catalog_name | Creates a new schema for catalog in the Metastore. The caller must be a metastore admin, or have the | |
update | update | full_name, deployment_name | Updates a schema for a catalog. The caller must be the owner of the schema or a metastore admin. If | |
delete | delete | full_name, deployment_name | force | Deletes the specified schema from the parent catalog. The caller must be the owner of the schema or an |
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 |
|---|---|---|
catalog_name | string | Parent catalog for schemas of interest. |
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
full_name | string | Full name of the schema. |
force | boolean | Force deletion even if the schema is not empty. |
include_browse | boolean | Whether to include schemas in the response for which the principal can only access selective metadata for |
max_results | integer | Maximum number of schemas to return. If not set, all the schemas are returned (not 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 0, the page length is set to a server configured value (recommended); - when set to a value less than 0, an invalid parameter error is returned; |
page_token | string | Opaque pagination token to go to next page based on previous query. |
SELECT examples
- get
- list
Gets the specified schema within the metastore. The caller must be a metastore admin, the owner of 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.catalog.schemas
WHERE full_name = '{{ full_name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND include_browse = '{{ include_browse }}'
;
Gets an array of schemas for a catalog in the metastore. If the caller is the metastore admin or 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.catalog.schemas
WHERE catalog_name = '{{ catalog_name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND include_browse = '{{ include_browse }}'
AND max_results = '{{ max_results }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- create
- Manifest
Creates a new schema for catalog in the Metastore. The caller must be a metastore admin, or have the
INSERT INTO databricks_workspace.catalog.schemas (
name,
catalog_name,
comment,
properties,
storage_root,
deployment_name
)
SELECT
'{{ name }}' /* required */,
'{{ catalog_name }}' /* required */,
'{{ comment }}',
'{{ properties }}',
'{{ storage_root }}',
'{{ 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: "{{ deployment_name }}"
description: Required parameter for the schemas resource.
- name: name
value: "{{ name }}"
description: |
Name of schema, relative to parent catalog.
- name: catalog_name
value: "{{ catalog_name }}"
description: |
Name of parent catalog.
- name: comment
value: "{{ comment }}"
description: |
User-provided free-form text description.
- name: properties
value: "{{ properties }}"
description: |
A map of key-value properties attached to the securable.
- name: storage_root
value: "{{ storage_root }}"
description: |
Storage root URL for managed tables within schema.
UPDATE examples
- update
Updates a schema for a catalog. The caller must be the owner of the schema or a metastore admin. If
UPDATE databricks_workspace.catalog.schemas
SET
comment = '{{ comment }}',
enable_predictive_optimization = '{{ enable_predictive_optimization }}',
new_name = '{{ new_name }}',
owner = '{{ owner }}',
properties = '{{ properties }}'
WHERE
full_name = '{{ full_name }}' --required
AND 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
DELETE FROM databricks_workspace.catalog.schemas
WHERE full_name = '{{ full_name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND force = '{{ force }}'
;