iceberg-flink 十一:在dlink代码中建表增加catalog地址。

一:catalog

是存储元数据的地方。

二:表中增加catalog地址’

当我们映射iceberg表的时候,增加了地址,就会成功映射到表

CREATE CATALOG dk_empower WITH(
    'type'='iceberg',
    'catalog-type'='hadoop',
    'warehouse'='hdfs://cluster/iceberg/warehouse/iceberg_hadoop/dk_empower',
    'property-version'='1'
);


create table  dwd_dk_event_log (
      p_dt	        string,
      process_name	string,
      stage	        int,
      stage_name	string,
      event_id	    string,
      event_name	string,
      flag          int,
      state         int,
      `ts` timestamp_ltz,
      `ts1` as CAST(ts AS TIMESTAMP_LTZ(3)),
      WATERMARK FOR ts1 AS ts1 - INTERVAL '5' SECOND   -- 在t_s上定义5 秒延迟的 watermark
) with (
      'connector'='iceberg',
      'catalog-name'='dk_empower',
      'catalog-database'='ods',
      'catalog-table'='dwd_dk_event_log',
      'streaming'='true',
      'monitor-interval'='2s',
      'catalog-type'='hadoop',
      'warehouse'='hdfs://cluster/iceberg/warehouse/iceberg_hadoop/dk_empower'
      --'start-snapshot-id'=''
      );

你可能感兴趣的:(flink,数据库,大数据)