Skip to main content

Default catalog

This topic describes what the default catalog is, and how to query the internal data of CelerData by using the default catalog.

CelerData provides an internal catalog to manage the internal data in it. Each CelerData cluster has only one internal catalog named default_catalog. Currently, you cannot modify the name of the internal catalog or create a new internal catalog.

Query internal data

  1. Connect your CelerData cluster.

    • If you use the MySQL client to connect the CelerData cluster, you go to default_catalog by default after connecting.
    • If you use JDBC to connect the CelerData cluster, you can go directly to the destination database in the default catalog by specifying default_catalog.db_name when connecting.
  2. (Optional) Use SHOW DATABASES to view databases:

    SHOW DATABASES;

    Or

    SHOW DATABASES FROM <catalog_name>;
  3. (Optional) Use SET CATALOG to switch to the destination catalog in the current session:

    SET CATALOG <catalog_name>;

    Then, use USE to specify the active database in the current session:

    USE <db_name>;

    Or, you can use USE to directly go to the active database in the destination catalog:

    USE <catalog_name>.<db_name>;
  4. Use SELECT to query internal data:

    SELECT * FROM <table_name>;

    If you do not specify the active database in the preceding steps, you can directly specify it in a select query:

    SELECT * FROM <db_name>.<table_name>;

    Or

    SELECT * FROM default_catalog.<db_name>.<table_name>;

Examples

To query data in olap_db.olap_table, perform the following steps:

  1. Use olap_db as the current database.

    USE olap_db;
  2. Query data from olap_table.

    SELECT * FROM olap_table limit 1;