CREATE DATABASE
Description
This statement is used to create a new database
Syntax:
CREATE DATABASE [IF NOT EXISTS] db_name
[PROPERTIES ("key"="value", ...)] ;
PROPERTIES Additional information of a database, can be defaulted.
- In case of iceberg, the following information needs to be provided in the properties.
PROPERTIES (
"iceberg.database" = "iceberg_db_name",
"iceberg.hive.metastore.uris" = "thrift://127.0.0.1:9083",
"iceberg.catalog.type" = "HIVE_CATALOG"
)
iceberg.database
is the name of the database corresponding to Iceberg.iceberg.hive.metastore.uris
is the address of the hive metastore service.iceberg.catalog.type
defaults toHIVE_CATALOG
. Currently, onlyHIVE_CATALOG
is supported, more Iceberg catalog types will be supported later.
example
Create a new database db_test
CREATE DATABASE db_test;
Create a new Iceberg database iceberg_test
CREATE DATABASE `iceberg_test`
PROPERTIES (
"iceberg.database" = "doris",
"iceberg.hive.metastore.uris" = "thrift://127.0.0.1:9083",
"iceberg.catalog.type" = "HIVE_CATALOG"
);
keyword
CREATE,DATABASE