Flink IDEA中使用Iceberg

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Flink IDEA中使用Iceberg

Luna Wong
 代码如下,Flink metastore报错日志: AlreadyExistsException(message:Database
default already exists)

但是我已经 USE了 luna db啊?很奇怪

      tEnv.executeSql("CREATE CATALOG iceberg_hive WITH (\n" +
            "  'type'='iceberg',\n" +
            "  'catalog-type'='hive',\n" +
            "  'uri'='thrift://kudu1:9083',\n" +
            "  'clients'='2',\n" +
            "  'property-version'='1',\n" +
            "  'warehouse'='hdfs://ns1//user/hive/warehouse'\n" +
            ")");
        tEnv.executeSql("USE CATALOG iceberg_hive");

//        tEnv.executeSql("CREATE DATABASE luna");
                tEnv.executeSql("USE luna");

        tEnv.executeSql("CREATE TABLE iceberg_hive.luna.dwd (\n" +
            "    id BIGINT COMMENT 'unique id',\n" +
            "    name STRING\n" +
            ")");

        tEnv.executeSql("CREATE TABLE iceberg_hive.luna.ads (\n" +
            "    id BIGINT COMMENT 'unique id',\n" +
            "    name STRING\n" +
            ")");