iceberg集成Hive

添加jar包

wget https://repo1.maven.org/maven2/org/apache/iceberg/iceberg-hive-runtime/0.13.1/iceberg-hive-runtime-0.13.1.jar
方法1:放到hive的lib目录下
方法2:add jar /path/to/iceberg-hive-runtime-0.13.1.jar;

注册catalog

SET iceberg.catalog.another_hive.type=hive;
SET iceberg.catalog.another_hive.uri=thrift://es2:9083;
SET iceberg.catalog.another_hive.clients=10;
SET iceberg.catalog.another_hive.warehouse=hdfs://bigdataytx/iceberg/hive;

创建指定catalog的iceberg表

SET iceberg.catalog.hadoop_cat.type=hadoop;
SET iceberg.catalog.hadoop_cat.warehouse=hdfs://bigdataytx/iceberg/hadoop_cat;
CREATE TABLE test.ice_test (
  id bigint, name string
) PARTITIONED BY (
  dept string
) STORED BY 'org.apache.iceberg.mr.hive.HiveIcebergStorageHandler'
LOCATION 'hdfs://bigdataytx/iceberg/hadoop_cat/test/ice_test'
TBLPROPERTIES ('iceberg.catalog'='hadoop_cat');

插入数据

insert into ice_test values(1,"justin",current_date());

删除iceberg表

drop table ice_test;

你可能感兴趣的:(数据湖,hadoop,hive,hadoop,iceberg)