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
internal
cannot 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
type
cannot be modified. - properties of builtin catalog
internal
cannot 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
internal
cannot be modified
Exampleβ
-
rename catalog ctlg_hive to hive
ALTER CATALOG ctlg_hive RENAME hive;
-
modify property
hive.metastore.uris
of 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";