Project: StarRocks (App Definition and Development / Database)
File: catalog_overview.md

displayed_sidebar: "English" This topic describes what a catalog is, and how to manage and query internal data and external data by using a catalog. StarRocks supports the catalog feature from v2.3 onwards. Catalogs enable you to manage internal and external data in one system and offer a flexible way for you to easily query and analyze data that is stored in various external systems. Internal data: refers to the data stored in StarRocks. External data: refers to the data stored in an external data source, such as Apache Hive, Apache Iceberg, Apache Hudi, Delta Lake, and JDBC. Currently, StarRocks provides two types of catalogs: internal catalog and external catalog. Internal catalog manages internal data of StarRocks. For example, if you execute the CREATE DATABASE or CREATE TABLE statements to create a database or a table, the database or table is stored in the internal catalog. Each StarRocks cluster has only one internal catalog named . External catalog acts like a link to externally managed metastores, which grants StarRocks direct access to external data sources. You can query external data directly with zero data loading or migration. Currently, StarRocks supports the following types of external catalogs: : used to query data from Hive. : used to query data from Iceberg. : used to query data from Hudi. : used to query data from Delta Lake. : used to query data from JDBC-compatible data sources. : used to query data from Elasticsearch. Elasticsearch catalogs are supported from v3.1 onwards. : used to query data from Paimon. Paimon catalogs are supported from v3.1 onwards. : used to query data from from Hive, Iceberg, Hudi, and Delta Lake data sources as a unified data source. Unified catalogs are supported from v3.2 onwards. StarRocks interacts with the following two components of external data sources when you query external data: Metastore service: used by the FEs to access the metadata of external data sources. The FEs generate a query execution plan based on the metadata. Data storage system: used to store external data. Both distributed file systems and object storage systems can be used as data storage systems to store data files in various formats. After the FEs distribute the query execution plan to all BEs or CNs, all BEs or CNs scan the target external data in parallel, perform calculations, and then return the query result. You can use the statement to switch to a specified catalog in the current session. Then, you can query data by using that catalog. To query data in StarRocks, see . To query data from external data sources, see . To perform a cross-catalog federated query from your current catalog, specify the data you want to query in the `catalogname.databasename` or `catalogname.databasename.table_name` format. Query `hivetable` in `hivedb` when the current session is `defaultcatalog.olapdb`. ```SQL SELECT * FROM hivecatalog.hivedb.hive_table; ``` Query `olaptable` in `defaultcatalog` when the current session is `hivecatalog.hivedb`. ```SQL SELECT * FROM defaultcatalog.olapdb.olap_table; ``` Perform a JOIN query on `hivetable` in `hivecatalog` and `olaptable` in `defaultcatalog` when the current session is `hivecatalog.hivedb`. ```SQL SELECT * FROM hivetable h JOIN defaultcatalog.olapdb.olaptable o WHERE h.id = o.id; ``` Perform a JOIN query on `hivetable` in `hivecatalog` and `olaptable` in `defaultcatalog` by using a JOIN clause when the current session is another catalog. ```SQL SELECT * FROM hivecatalog.hivedb.hivetable h JOIN defaultcatalog.olapdb.olaptable o WHERE h.id = o.id; ```