SHOW-CATALOGS

Name

SHOW CATALOGS

Description

该语句用于显示已存在是数据目录(catalog)

语法:

  1. SHOW CATALOGS [LIKE]

说明:

LIKE:可按照 CATALOG 名进行模糊查询

返回结果说明:

  • CatalogId:数据目录唯一 ID
  • CatalogName:数据目录名称。其中 internal 是默认内置的 catalog,不可修改。
  • Type:数据目录类型。
  • IsCurrent: 是否为当前正在使用的数据目录。

Example

  1. 查看当前已创建的数据目录

    1. SHOW CATALOGS;
    2. +-----------+-------------+----------+-----------+-------------------------+---------------------+------------------------+
    3. | CatalogId | CatalogName | Type | IsCurrent | CreateTime | LastUpdateTime | Comment |
    4. +-----------+-------------+----------+-----------+-------------------------+---------------------+------------------------+
    5. | 130100 | hive | hms | | 2023-12-25 16:11:41.687 | 2023-12-25 20:43:18 | NULL |
    6. | 0 | internal | internal | yes | UNRECORDED | NULL | Doris internal catalog |
    7. +-----------+-------------+----------+-----------+-------------------------+---------------------+------------------------+

    ```

  2. 按照目录名进行模糊搜索

    1. SHOW CATALOGS LIKE 'hi%';
    2. +-----------+-------------+----------+-----------+-------------------------+---------------------+------------------------+
    3. | CatalogId | CatalogName | Type | IsCurrent | CreateTime | LastUpdateTime | Comment |
    4. +-----------+-------------+----------+-----------+-------------------------+---------------------+------------------------+
    5. | 130100 | hive | hms | | 2023-12-25 16:11:41.687 | 2023-12-25 20:43:18 | NULL |
    6. +-----------+-------------+----------+-----------+-------------------------+---------------------+------------------------+

    ```

Keywords

SHOW, CATALOG, CATALOGS

Best Practice