Edit

CREATE EXTERNAL CATALOG

Description

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:

This statement requires no privileges for execution. 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 external catalog topic.

Syntax

CREATE EXTERNAL CATALOG catalog_name 
PROPERTIES ("key"="value", ...);

Parameters

ParameterRequiredDescription
catalog_nameYesThe name of the external catalog. The naming conventions are as follows:
  • The name can contain letters, digits (0-9), and underscores (_). It must start with a letter.
  • The name cannot exceed 64 characters in length.
PROPERTIESYesThe properties of an external catalog. Configure properties based on the types of external catalogs. For more information, see Hive catalog, Iceberg catalog and Hudi catalog.

Examples

Example 1: Create a Hive catalog named hive1.

CREATE EXTERNAL CATALOG hive1
PROPERTIES(
   "type"="hive", 
   "hive.metastore.uris"="thrift://x.x.x.x:9083"
);

Example 2: Create an Iceberg catalog named iceberg1.

CREATE EXTERNAL CATALOG iceberg1
PROPERTIES(
    "type"="iceberg",
    "iceberg.catalog.type"="hive",
    "iceberg.catalog.hive.metastore.uris"="thrift://x.x.x.x:9083"
);

Example 3: Create a Hudi catalog named hudi1.

CREATE EXTERNAL CATALOG hudi1
PROPERTIES(
    "type"="hudi",
    "hive.metastore.uris"="thrift://x.x.x.x:9083"
);

References

  • To view all catalogs in your StarRocks cluster, see SHOW CATALOGS.
  • To delete an external catalog from your StarRocks cluster, see DROP CATALOG.