CREATE CATALOG hive WITH ( --创建hive的catalog
    'type' = 'hive',
    'hive-conf-dir' = '/app/wwwroot/MBDC/hive/conf/',
    'hadoop-conf-dir'='/app/wwwroot/MBDC/hadoop/etc/hadoop/'
);

USE CATALOG hive; 
USE offline_db; --选择库
set table.sql-dialect=hive; --设置方言

CREATE TABLE hive_stream_table (
  user_id STRING,
  order_amount DOUBLE
) PARTITIONED BY (dt STRING, hr STRING) STORED AS parquet TBLPROPERTIES (
  'partition.time-extractor.timestamp-pattern'='$dt $hr:00:00',
  'sink.partition-commit.trigger'='partition-time',
  'sink.partition-commit.delay'='1min',
  'sink.semantic' = 'exactly-once',
  'sink.rolling-policy.rollover-interval' ='1min',
  'sink.rolling-policy.check-interval'='1min',
  'sink.partition-commit.policy.kind'='metastore,success-file'
);