Updated on 2024-11-29 GMT+08:00

Multi-Catalog

Multi-Catalog is designed to make it easier to connect to external data catalogs to enhance Doris's data lake analysis and federated data query capabilities.

With the advent of Multi-Catalog, Doris now has a new three-tiered metadata hierarchy (catalog -> database -> table), which means users can connect to external data at the catalog level.

Basic Concepts

  • Internal Catalog

    Existing databases and tables in Doris are all under the Internal catalog, which is the default catalog in Doris and cannot be modified or deleted.

  • External Catalog

    Users can create an external catalog using the CREATE CATALOG command, and view the existing catalogs via the SHOW CATALOGS command.

  • Switch Catalog

    After login, you will enter the Internal catalog by default. Then, you can view or switch to your target database via SHOW DATABASES and USE DB .

    You can run the SWITCH command to switch between catalog. For example:

    SWITCH internal;
    SWITCH hive_catalog;

    After switching catalog, you can view or switch to your target database in that catalog via SHOW DATABASES and USE DB. Doris automatically synchronizes databases and tables in catalog. You can view and access data in external catalogs the same way as doing that in internal catalogs.

    Doris only supports read-only access to data in external catalogs currently.

  • Delete Catalog

    Databases and tables in external catalogs are for read only. External Catalogs are deletable via the DROP CATALOG command. (The Internal catalog cannot be deleted.) You can run the DROP CATALOG command to delete an external catalog.

    This operation only deletes the mapping information of the catalog in Doris, but does not modify or change the content of any external data catalog.

  • Resource

    Resource is a set of configurations. You can run the CREATE RESOURCE command to create a resource. Then, you can use the resource when creating a catalog.

    A resource can be used by multiple catalogs to reuse the configuration of the resource.