schemas
Operations on a schemas
resource.
Overview
Name | schemas |
Type | Resource |
Id | databricks_workspace.unitycatalog.schemas |
Fields
Name | Datatype |
---|---|
name | string |
browse_only | boolean |
catalog_name | string |
catalog_type | string |
comment | string |
created_at | integer |
created_by | string |
effective_predictive_optimization_flag | object |
enable_predictive_optimization | string |
full_name | string |
metastore_id | string |
owner | string |
properties | object |
schema_id | string |
storage_location | string |
storage_root | string |
updated_at | integer |
updated_by | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | full_name, 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 | catalog_name, 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 |
delete | DELETE | full_name, 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. |
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 the caller is a metastore admin, only the |
SELECT
examples
- schemas (get)
- schemas (list)
SELECT
name,
browse_only,
catalog_name,
catalog_type,
comment,
created_at,
created_by,
effective_predictive_optimization_flag,
enable_predictive_optimization,
full_name,
metastore_id,
owner,
properties,
schema_id,
storage_location,
storage_root,
updated_at,
updated_by
FROM databricks_workspace.unitycatalog.schemas
WHERE full_name = '{{ full_name }}' AND
deployment_name = '{{ deployment_name }}';
SELECT
name,
browse_only,
catalog_name,
catalog_type,
comment,
created_at,
created_by,
effective_predictive_optimization_flag,
enable_predictive_optimization,
full_name,
metastore_id,
owner,
properties,
schema_id,
storage_location,
storage_root,
updated_at,
updated_by
FROM databricks_workspace.unitycatalog.schemas
WHERE catalog_name = '{{ catalog_name }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new schemas
resource.
- schemas
- Manifest
/*+ create */
INSERT INTO databricks_workspace.unitycatalog.schemas (
deployment_name,
data__name,
data__catalog_name,
data__comment,
data__properties,
data__storage_root
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ catalog_name }}',
'{{ comment }}',
'{{ properties }}',
'{{ storage_root }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: catalog_name
value: string
- name: comment
value: string
- name: properties
value:
property1: string
property2: string
- name: storage_root
value: string
UPDATE
example
Updates a schemas
resource.
/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.unitycatalog.schemas
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE full_name = '{{ full_name }}' AND
deployment_name = '{{ deployment_name }}';
DELETE
example
Deletes a schemas
resource.
/*+ delete */
DELETE FROM databricks_workspace.unitycatalog.schemas
WHERE full_name = '{{ full_name }}' AND
deployment_name = '{{ deployment_name }}';