CREATE EXTERNAL CATALOG

更新时间:
复制 MD 格式

CREATE EXTERNAL CATALOG creates an External Catalog that connects AnalyticDB for MySQL to external data lakes (Hive, Iceberg, Delta, Paimon) or MySQL-compatible databases.

Syntax

CREATE EXTERNAL CATALOG <catalog_name>
[COMMENT "<comment>"]
PROPERTIES (
  "key" = "value"[, ...]
);

Parameters

Parameter

Required

Description

catalog_name

Yes

The catalog name. Must start with a lowercase letter, contain only lowercase letters, digits, and underscores (_), and be 2 to 64 characters long.

COMMENT

No

A description of the catalog.

type

Yes

The catalog type. Valid values: hive, iceberg, delta, paimon, and mysql.

property_key / property_value

Yes

Connection properties for the catalog. Each catalog type requires different properties. For details, see External Catalog.

Examples

Example 1: Create a Hive Catalog named hive_hms_catalog that uses Hive Metastore as the metadata service.

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

Example 2: Create an Iceberg Catalog named iceberg_hms_catalog that uses Hive Metastore as the metadata service.

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

Example 3: Create a Paimon Catalog named paimon_fs_catalog that uses FileSystem as the metadata service.

CREATE EXTERNAL CATALOG paimon_fs_catalog
PROPERTIES (
  "type" = "paimon",
  "paimon.catalog.metastore" = "filesystem",
  "paimon.catalog.warehouse" = "oss://test_bucket/test_path/test_warehouse/"
);

Usage notes

  • Before you create an External Catalog, ensure that the cluster and the target data source can communicate over the network.

  • For required and optional properties for each catalog type, see External Catalog.

  • Minimum version requirements for each catalog type:

    • Paimon Catalog: AnalyticDB for MySQL 3.2.7 or later.

    • Hive Catalog: AnalyticDB for MySQL 3.2.8 or later.

    • Iceberg Catalog: AnalyticDB for MySQL 3.2.8 or later.

    • Delta Lake Catalog: AnalyticDB for MySQL 3.2.8 or later.

    • MySQL Catalog: AnalyticDB for MySQL 3.2.8 or later.

Related documents