Skip to main content
Version: 2.5

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:

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 is case-sensitive and cannot exceed 1023 characters in length.
commentNoThe description of the external catalog.
PROPERTIESYesThe properties of an external catalog. Configure properties based on the types of external catalogs. For more information, see Hive catalog, Iceberg catalog, Hudi catalog, and Delta Lake catalog.

Examples

Example 1: Create a Hive catalog named hive_metastore_catalog. The corresponding Hive cluster uses Hive metastore as its metadata service.

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

Example 2: Create a Hive catalog named hive_glue_catalog. The corresponding Hive cluster uses AWS Glue as its metadata service.

CREATE EXTERNAL CATALOG hive_glue_catalog
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 iceberg_metastore_catalog. The corresponding Iceberg cluster uses Hive metastore as its metadata service.

CREATE EXTERNAL CATALOG iceberg_metastore_catalog
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 iceberg_glue_catalog. The corresponding Iceberg cluster uses AWS Glue as its metadata service.

CREATE EXTERNAL CATALOG iceberg_glue_catalog
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 hudi_metastore_catalog. The corresponding Hudi cluster uses Hive metastore as its metadata service.

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

Example 6: Create a Hudi catalog named hudi_glue_catalog. The corresponding Hudi cluster uses AWS Glue as its metadata service.

CREATE EXTERNAL CATALOG hudi_glue_catalog
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 delta_metastore_catalog. The corresponding Delta Lake service uses Hive metastore as its metadata service.

CREATE EXTERNAL CATALOG delta_metastore_catalog
PROPERTIES(
"type"="deltalake",
"hive.metastore.uris"="thrift://xx.xx.xx.xx:9083"
);

Example 8: Create a Delta Lake catalog named delta_glue_catalog. The corresponding Delta Lake service uses AWS Glue as its metadata service.

CREATE EXTERNAL CATALOG delta_glue_catalog
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"
);

References

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