diff --git a/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-CATALOG.md b/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-CATALOG.md new file mode 100644 index 0000000000..207986f9ef --- /dev/null +++ b/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-CATALOG.md @@ -0,0 +1,83 @@ +--- +{ + "title": "ALTER-CATALOG", + "language": "en" +} +--- + + + +## ALTER-CATALOG + +### Name + + + +ALTER CATALOG + + + +### Description + +This statement is used to set properties of the specified catalog. (administrator only) + +1) Rename the catalog + +```sql +ALTER CATALOG catalog_name RENAME new_catalog_name; +``` + +illustrate: +- 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 + +2) Modify / add properties for the catalog + +```sql +ALTER CATALOG catalog_name SET PROPERTIES ('key1' = 'value1' [, 'key' = 'value2']); +``` + +Update values of specified keys. If a key does not exist in the catalog properties, it will be added. + +illustrate: +- property `type` cannot be modified. +- properties of builtin catalog `internal` cannot be modified. + +### Example + +1. rename catalog ctlg_hive to hive + +```sql +ALTER CATALOG ctlg_hive RENAME hive; +``` + +3. modify property `hive.metastore.uris` of catalog hive + +```sql +ALTER CATALOG hive SET PROPERTIES ('hive.metastore.uris'='thrift://172.21.0.1:9083'); +``` + +### Keywords + +ALTER,CATALOG,RENAME,PROPERTY + +### Best Practice + diff --git a/docs/sidebars.json b/docs/sidebars.json index 2dfd53a662..b5cce77f2d 100644 --- a/docs/sidebars.json +++ b/docs/sidebars.json @@ -713,6 +713,7 @@ "type": "category", "label": "Alter", "items": [ + "sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-CATALOG", "sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-DATABASE", "sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-TABLE-BITMAP", "sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-TABLE-PARTITION", diff --git a/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-CATALOG.md b/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-CATALOG.md new file mode 100644 index 0000000000..ceff0e82d5 --- /dev/null +++ b/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Alter/ALTER-CATALOG.md @@ -0,0 +1,81 @@ +--- +{ + "title": "ALTER-CATALOG", + "language": "zh-CN" +} +--- + + + +## ALTER-CATALOG + +### Name + + + +ALTER CATALOG + + + +### Description + +该语句用于设置指定数据目录的属性。(仅管理员使用) + +1) 重命名数据目录 + +```sql +ALTER CATALOG catalog_name RENAME new_catalog_name; +``` +注意: +- `internal` 是内置数据目录,不允许重命名 +- 对 `catalog_name` 拥有 Alter 权限才允许对其重命名 +- 重命名数据目录后,如需要,请使用 REVOKE 和 GRANT 命令修改相应的用户权限。 + +2) 设置数据目录属性 + +```sql +ALTER CATALOG catalog_name SET PROPERTIES ('key1' = 'value1' [, 'key' = 'value2']); +``` + +更新指定属性的值为指定的 value。如果 SET PROPERTIES 从句中的 key 在指定 catalog 属性中不存在,则新增此 key。 + +注意: +- 不可更改数据目录类型,即 `type` 属性 +- 不可更改内置数据目录 `internal` 的属性 + +### Example + +1. 将数据目录 ctlg_hive 重命名为 hive + +```sql +ALTER CATALOG ctlg_hive RENAME hive; +``` + +3. 更新名为 hive 数据目录的属性 `hive.metastore.uris` + +```sql +ALTER CATALOG hive SET PROPERTIES ('hive.metastore.uris'='thrift://172.21.0.1:9083'); +``` + +### Keywords + +ALTER,CATALOG,RENAME,PROPERTY + +### Best Practice