beeline -u jdbc:hive2://IP:10000 -n hdfs
--SET iceberg.engine.hive.enabled=true;
SET spark.sql.catalog.spark_iceberg_hive=org.apache.iceberg.spark.SparkCatalog;
SET spark.sql.catalog.spark_iceberg_hive.type=hive;
SET spark.sql.catalog.spark_iceberg_hive.uri=thrift://IP:8080,thrift://IP:8080;
use spark_iceberg_hive;
SET spark.sql.catalog.spark_iceberg_hadoop=org.apache.iceberg.spark.SparkCatalog;
SET spark.sql.catalog.spark_iceberg_hadoop.type=hadoop;
SET spark.sql.catalog.spark_iceberg_hadoop.warehouse=hdfs://clusterHA/user/hive/iceberg_hadoop;
use spark_iceberg_hadoop;
表创建
创建表
createtable T (
id intnotnull comment '主键id',
name string, age int, m decimal(12,5))
using iceberg comment '测试表2';
创建表
createtable T(id int)
using iceberg
stored by'org.apache.iceberg.mr.hive.HiveIcebergStorageHandler';
创建分区表
createtable T (
id int comment '主键id',
name string,
age int,
regist_ts timestamp)
using iceberg partitioned by (bucket(16, id), days(regist_ts), name)
comment '表注释'
tblproperties ('current-snapshot-id'='none','format'='iceberg/parquet','format-version'='1');
显示表结构
desc formatted T;
表编辑
altertable T rename to T2;
altertable T set tblproperties('comment'='表注释2');
altertable T set tblproperties('format-version'='2');
altertable T unset tblproperties('format','format-version');
altertable T droppartition field bucket(16, id);
altertable T droppartition field id;
altertable T addpartition field bucket(16,id2);
altertable T addpartition field id3;
altertable T replace partition field days(regist_ts) with days(ts);
altertable T addcolumn id bigint after id2 comment '注释';
altertable T dropcolumn id;
altertable T altercolumn id type long comment '字段注释id';
altertable T altercolumn id comment '注释';
altertable T altercolumn id first;
altertable T altercolumn id after id2;
altertable T altercolumn id setnotnull;
altertable T altercolumn id dropnotnull;
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
2022-11-22 JVM
2022-11-22 常用
2022-11-22 Hbase
2022-11-22 Zookeeper
2022-11-22 Docker
2022-11-22 Hive
2022-11-22 Idea