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

displayed_sidebar: "English" Creates an external catalog. You can use external catalogs to query data in external data sources without loading data into StarRocks or creating external tables. Currently, you can create the following types of external catalogs: : used for querying data from Apache Hive. : used for querying data from Apache Iceberg. : used for querying data from Apache 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 Apache 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. NOTE In v3.0 and later, this statement requires SYSTEM-level CREATE EXTERNAL CATALOG privilege. Before you create external catalogs, configure your StarRocks cluster to meet the requirements of the data storage system (such as Amazon S3), metadata service (such as Hive metastore), and authenticating service (such as Kerberos) of external data sources. For more information, see the "Before you begin" section in each . ```SQL CREATE EXTERNAL CATALOG <catalog_name> [COMMENT <comment>] PROPERTIES ("key"="value", ...) ``` | Parameter | Required | Description | | - | | | | catalog_name | Yes | The name of the external catalog. For the naming conventions, see . | | comment | No | The description of the external catalog. | | PROPERTIES | Yes | The properties of an external catalog. Configure properties based on the types of external catalogs. For more information, see , , , , and . | Example 1: Create a Hive catalog named `hivemetastorecatalog`. The corresponding Hive cluster uses Hive metastore as its metadata service. ```SQL CREATE EXTERNAL CATALOG hivemetastorecatalog PROPERTIES( "type"="hive", "hive.metastore.uris"="thrift://xx.xx.xx.xx:9083" ); ``` Example 2: Create a Hive catalog named `hivegluecatalog`. The corresponding Hive cluster uses AWS Glue as its metadata service. ```SQL CREATE EXTERNAL CATALOG hivegluecatalog PROPERTIES( "type"="hive", "hive.metastore.type"="glue", "aws.hive.metastore.glue.aws-access-key"="xxxxxx", "aws.hive.metastore.glue.aws-secret-key"="xxxxxxxxxxxx", "aws.hive.metastore.glue.endpoint"="https://glue.x-x-x.amazonaws.com" ); ``` Example 3: Create an Iceberg catalog named `icebergmetastorecatalog`. The corresponding Iceberg cluster uses Hive metastore as its metadata service. ```SQL CREATE EXTERNAL CATALOG icebergmetastorecatalog PROPERTIES( "type"="iceberg", "iceberg.catalog.type"="hive", "iceberg.catalog.hive.metastore.uris"="thrift://xx.xx.xx.xx:9083" ); ``` Example 4: Create an Iceberg catalog named `iceberggluecatalog`. The corresponding Iceberg cluster uses AWS Glue as its metadata service. ```SQL CREATE EXTERNAL CATALOG iceberggluecatalog PROPERTIES( "type"="iceberg", "iceberg.catalog.type"="glue", "aws.hive.metastore.glue.aws-access-key"="xxxxx", "aws.hive.metastore.glue.aws-secret-key"="xxxxxxxxxxxx", "aws.hive.metastore.glue.endpoint"="https://glue.x-x-x.amazonaws.com" ); ``` Example 5: Create a Hudi catalog named `hudimetastorecatalog`. The corresponding Hudi cluster uses Hive metastore as its metadata service. ```SQL CREATE EXTERNAL CATALOG hudimetastorecatalog PROPERTIES( "type"="hudi", "hive.metastore.uris"="thrift://xx.xx.xx.xx:9083" ); ``` Example 6: Create a Hudi catalog named `hudigluecatalog`. The corresponding Hudi cluster uses AWS Glue as its metadata service. ```SQL CREATE EXTERNAL CATALOG hudigluecatalog PROPERTIES( "type"="hudi", "hive.metastore.type"="glue", "aws.hive.metastore.glue.aws-access-key"="xxxxxx", "aws.hive.metastore.glue.aws-secret-key"="xxxxxxxxxxxx", "aws.hive.metastore.glue.endpoint"="https://glue.x-x-x.amazonaws.com" ); ``` Example 7: Create a Delta Lake catalog named `deltametastorecatalog`. The corresponding Delta Lake service uses Hive metastore as its metadata service. ```SQL CREATE EXTERNAL CATALOG deltametastorecatalog PROPERTIES( "type"="deltalake", "hive.metastore.uris"="thrift://xx.xx.xx.xx:9083" ); ``` Example 8: Create a Delta Lake catalog named `deltagluecatalog`. The corresponding Delta Lake service uses AWS Glue as its metadata service. ```SQL CREATE EXTERNAL CATALOG deltagluecatalog PROPERTIES( "type"="deltalake", "hive.metastore.type"="glue", "aws.hive.metastore.glue.aws-access-key"="xxxxxx", "aws.hive.metastore.glue.aws-secret-key"="xxxxxxxxxxxx", "aws.hive.metastore.glue.endpoint"="https://glue.x-x-x.amazonaws.com" ); ``` To view all catalogs in your StarRocks cluster, see . To view the creation statement of an external catalog, see . To delete an external catalog from your StarRocks cluster, see .