CREATE DATABASE

Description

  1. This statement is used to create a new database
  2. Syntax:
  3. CREATE DATABASE [IF NOT EXISTS] db_name
  4. [PROPERTIES ("key"="value", ...)] ;
  1. PROPERTIES Additional information of a database, can be defaulted.

    1. In case of iceberg, the following information needs to be provided in the properties.
    1. PROPERTIES (
    2. "iceberg.database" = "iceberg_db_name",
    3. "iceberg.hive.metastore.uris" = "thrift://127.0.0.1:9083",
    4. "iceberg.catalog.type" = "HIVE_CATALOG"
    5. )

    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 to HIVE_CATALOG. Currently, only HIVE_CATALOG is supported, more Iceberg catalog types will be supported later.

example

  1. Create a new database db_test

    1. CREATE DATABASE db_test;
  2. Create a new Iceberg database iceberg_test

    1. CREATE DATABASE `iceberg_test`
    2. PROPERTIES (
    3. "iceberg.database" = "doris",
    4. "iceberg.hive.metastore.uris" = "thrift://127.0.0.1:9083",
    5. "iceberg.catalog.type" = "HIVE_CATALOG"
    6. );

keyword

CREATE,DATABASE