ALTER CATALOG
Description
This statement is used to set properties of the specified catalog.
Syntax
-
Rename the catalog
ALTER CATALOG <catalog_name> RENAME <new_catalog_name>; -
Modify / Add properties for the catalog
ALTER CATALOG <catalog_name> SET PROPERTIES ('<key>' = '<value>' [, ... ]); -
Modify comment for the catalog
ALTER CATALOG <catalog_name> MODIFY COMMENT "<new catalog comment>";
Required Parameters
1. <catalog_name>
The name of the catalog that should be modified
2. <new_catalog_name>
New catalog name after modification
3. '<key>' = '<value>'
The key and value of the catalog properties that need to be modified / added
4. <new catalog comment>
Modified catalog comment
Access Control Requirements
| Privilege | Object | Notes |
|---|---|---|
| ALTER_PRIV | Catalog | The ALTER_PRIV of the catalog is required |
Usage Notes
- Rename the catalog
- The builtin catalog
internalcannot be renamed - Only the one who has at least Alter privilege can rename a catalog
- After renaming the catalog, use the REVOKE and GRANT commands to modify the appropriate user permissions
- Modify / Add properties for the catalog
- property
typecannot be modified. - properties of builtin catalog
internalcannot be modified. - Update values of specified keys. If a key does not exist in the catalog properties, it will be added.
- Modify comment for the catalog
- The builtin catalog
internalcannot be modified
Example
-
rename catalog ctlg_hive to hive
ALTER CATALOG ctlg_hive RENAME hive; -
modify property
hive.metastore.urisof catalog hiveALTER CATALOG hive SET PROPERTIES ('hive.metastore.uris'='thrift://172.21.0.1:9083'); -
modify comment of catalog hive
ALTER CATALOG hive MODIFY COMMENT "new catalog comment";