CREATE-CATALOG

Name

CREATE CATALOG

Description

This statement is used to create an external catalog

Syntax:

  1. CREATE CATALOG [IF NOT EXISTS] catalog_name [comment]
  2. PROPERTIES ("key"="value", ...);

Example

  1. Create catalog hive

    1. CREATE CATALOG hive comment 'hive catalog' PROPERTIES (
    2. 'type'='hms',
    3. 'hive.metastore.uris' = 'thrift://127.0.0.1:7004',
    4. 'dfs.nameservices'='HANN',
    5. 'dfs.ha.namenodes.HANN'='nn1,nn2',
    6. 'dfs.namenode.rpc-address.HANN.nn1'='nn1_host:rpc_port',
    7. 'dfs.namenode.rpc-address.HANN.nn2'='nn2_host:rpc_port',
    8. 'dfs.client.failover.proxy.provider.HANN'='org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider'
    9. );
  2. Create catalog es

    1. CREATE CATALOG es PROPERTIES (
    2. "type"="es",
    3. "hosts"="http://127.0.0.1:9200"
    4. );
  3. Create catalog jdbc

    mysql

    1. CREATE CATALOG jdbc PROPERTIES (
    2. "type"="jdbc",
    3. "user"="root",
    4. "password"="123456",
    5. "jdbc_url" = "jdbc:mysql://127.0.0.1:3316/doris_test?useSSL=false",
    6. "driver_url" = "https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/jdbc_driver/mysql-connector-java-8.0.25.jar",
    7. "driver_class" = "com.mysql.cj.jdbc.Driver"
    8. );

    postgresql

    1. CREATE CATALOG jdbc PROPERTIES (
    2. "type"="jdbc",
    3. "user"="postgres",
    4. "password"="123456",
    5. "jdbc_url" = "jdbc:postgresql://127.0.0.1:5432/demo",
    6. "driver_url" = "file:///path/to/postgresql-42.5.1.jar",
    7. "driver_class" = "org.postgresql.Driver"
    8. );

    clickhouse

    1. CREATE CATALOG jdbc PROPERTIES (
    2. "type"="jdbc",
    3. "user"="default",
    4. "password"="123456",
    5. "jdbc_url" = "jdbc:clickhouse://127.0.0.1:8123/demo",
    6. "driver_url" = "file:///path/to/clickhouse-jdbc-0.3.2-patch11-all.jar",
    7. "driver_class" = "com.clickhouse.jdbc.ClickHouseDriver"
    8. )

    oracle

    1. CREATE CATALOG jdbc PROPERTIES (
    2. "type"="jdbc",
    3. "user"="doris",
    4. "password"="123456",
    5. "jdbc_url" = "jdbc:oracle:thin:@127.0.0.1:1521:helowin",
    6. "driver_url" = "file:///path/to/ojdbc8.jar",
    7. "driver_class" = "oracle.jdbc.driver.OracleDriver"
    8. );

    SQLServer

    1. CREATE CATALOG sqlserver_catalog PROPERTIES (
    2. "type"="jdbc",
    3. "user"="SA",
    4. "password"="Doris123456",
    5. "jdbc_url" = "jdbc:sqlserver://localhost:1433;DataBaseName=doris_test",
    6. "driver_url" = "file:///path/to/mssql-jdbc-11.2.3.jre8.jar",
    7. "driver_class" = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    8. );

    SAP HANA

    1. CREATE CATALOG saphana_catalog PROPERTIES (
    2. "type"="jdbc",
    3. "user"="SYSTEM",
    4. "password"="SAPHANA",
    5. "jdbc_url" = "jdbc:sap://localhost:31515/TEST",
    6. "driver_url" = "file:///path/to/ngdbc.jar",
    7. "driver_class" = "com.sap.db.jdbc.Driver"
    8. );

    Trino

    1. CREATE CATALOG trino_catalog PROPERTIES (
    2. "type"="jdbc",
    3. "user"="hadoop",
    4. "password"="",
    5. "jdbc_url" = "jdbc:trino://localhost:8080/hive",
    6. "driver_url" = "file:///path/to/trino-jdbc-389.jar",
    7. "driver_class" = "io.trino.jdbc.TrinoDriver"
    8. );

    OceanBase

    1. CREATE CATALOG oceanbase_catalog PROPERTIES (
    2. "type"="jdbc",
    3. "user"="root",
    4. "password"="",
    5. "jdbc_url" = "jdbc:oceanbase://localhost:2881/demo",
    6. "driver_url" = "file:///path/to/oceanbase-client-2.4.2.jar",
    7. "driver_class" = "com.oceanbase.jdbc.Driver"
    8. );

Keywords

CREATE, CATALOG

Best Practice