CREATE CATALOG
Introduced or updated: v1.2.83
Defines and establishes a new catalog in the Databend query engine.
Syntax
CREATE CATALOG <catalog_name>
TYPE = <catalog_type>
CONNECTION = (
METASTORE_ADDRESS = '<hive_metastore_address>'
URL = '<data_storage_path>'
<connection_parameter> = '<connection_parameter_value>'
<connection_parameter> = '<connection_parameter_value>'
...
)
Parameter | Required? | Description |
---|---|---|
TYPE | Yes | Type of the catalog: 'HIVE' for Hive catalog or 'ICEBERG' for Iceberg catalog. |
METASTORE_ADDRESS | No | Hive Metastore address. Required for Hive catalog only. |
URL | Yes | Location of the external storage linked to this catalog. This could be a bucket or a folder within a bucket. For example, 's3://databend-toronto/'. |
connection_parameter | Yes | Connection parameters to establish connections with external storage. The required parameters vary based on the specific storage service and authentication methods. Refer to Connection Parameters for detailed information. |
Examples
This example demonstrates the creation of a catalog configured to interact with the Hive Metastore and access data stored on Amazon S3, located at 's3://databend-toronto/'.
CREATE CATALOG hive_ctl
TYPE = HIVE
CONNECTION =(
METASTORE_ADDRESS = '127.0.0.1:9083'
URL = 's3://databend-toronto/'
AWS_KEY_ID = '<your_key_id>'
AWS_SECRET_KEY = '<your_secret_key>'
);
This example demonstrates the creation of a catalog configured to interact with an Iceberg data storage located in MinIO at 's3://databend/iceberg/'.
CREATE CATALOG iceberg_ctl
TYPE = ICEBERG
CONNECTION = (
URL = 's3://databend/iceberg/'
AWS_KEY_ID = 'minioadmin'
AWS_SECRET_KEY = 'minioadmin'
ENDPOINT_URL = 'http://127.0.0.1:9000'
);