ALTER CATALOG
Applies to: Databricks SQL Databricks Runtime 10.4 LTS and above Unity Catalog only
Transfers the ownership of a catalog to a new principal or applies tags to a catalog.
Syntax
ALTER CATALOG [ catalog_name ]
{ [ SET ] OWNER TO principal
SET TAGS ( { tag_name = tag_value } [, ...] ) |
UNSET TAGS ( tag_name [, ...] ) } }
Parameters
-
The name of the catalog to be altered. If you provide no name the default is
hive_metastore
. [ SET ] OWNER TO principal
Transfers ownership of the catalog to
principal
.Applies to: Databricks SQL Databricks Runtime 11.3 LTS and above
SET
is allowed as an optional keyword.SET TAGS ( { tag_name = tag_value } [, …] )
Apply tags to the catalog. You need to have
use_catalog
permission to apply a tag to a catalog. See USE CATALOG.Applies to: Databricks SQL Databricks Runtime 13.3 LTS and above
UNSET TAGS ( tag_name [, …] )
Remove tags from the catalog. You need to have
use_catalog
permission to apply a tag to a catalog.Applies to: Databricks SQL Databricks Runtime 13.3 LTS and above
tag_name
A literal
STRING
. Thetag_name
must be unique within the catalog.tag_value
A literal
STRING
.
Examples
-- Creates a catalog named `some_cat`.
> CREATE CATALOG some_cat;
-- Transfer ownership of the catalog to another user
> ALTER CATALOG some_cat OWNER TO `alf@melmak.et`;
-- Applies three tags to the catalog named `test`.
> ALTER CATALOG test SET TAGS ('tag1' = 'val1', 'tag2' = 'val2', 'tag3' = 'val3');
-- Removes three tags from the catalog named `test`.
> ALTER CATALOG test UNSET TAGS ('tag1', 'tag2', 'tag3');