Skip to main content

SHOW CATALOGS

Description​

This statement is used for view created catalogs

Syntax​

SHOW CATALOGS [LIKE <catalog_name>]

illustrate:

  1. LIKE: Fuzzy query can be performed according to the catalog name

Optional Parameters​

1. <catalog_name>

The name of the catalog to be displayed.

Return Value​

Column NameDescription
CatalogIdUnique ID of the data catalog
CatalogNameName of the data catalog. The default built-in catalog is named "internal" and cannot be modified.
TypeType of the data catalog
IsCurrentIndicates whether it is the currently active data catalog
CreateTimeCreation time
LastUpdateTimeLast updated time
Commentcomments about the catalog

Access Control Requirements​

PrivilegeObjectNotes
ADMIN_PRIV / SELECT_PRIV / LOAD_PRIV / ALTER_PRIV / CREATE_PRIV / SHOW_VIEW_PRIV / DROP_PRIVCatalogOne of the above permissions is required.

Examples​

  1. View the data catalogs that have been created currently

    SHOW CATALOGS;
     +-----------+-------------+----------+-----------+-------------------------+---------------------+------------------------+
    | CatalogId | CatalogName | Type | IsCurrent | CreateTime | LastUpdateTime | Comment |
    +-----------+-------------+----------+-----------+-------------------------+---------------------+------------------------+
    | 130100 | hive | hms | | 2023-12-25 16:11:41.687 | 2023-12-25 20:43:18 | NULL |
    | 0 | internal | internal | yes | UNRECORDED | NULL | Doris internal catalog |
    +-----------+-------------+----------+-----------+-------------------------+---------------------+------------------------+
  2. Fuzzy query by catalog name

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