flink1.11.1集成iceberg0.11(hadoop_catalog)-(5)

7 篇文章 1 订阅
4 篇文章 0 订阅

创建hive on iceberg 外部表:

        

下载 jar包

地址;
https://repo.maven.apache.org/maven2/org/apache/iceberg/iceberg-hive-runtime/0.11.0/iceberg-hive-runtime-0.11.0.jar


将jar包放到hive的auxlib目录下

此步骤略过

进入 hive

hive
开启参数
set iceberg.engine.hive.enabled=true;
建表:
create table iceberg_ods.app_log_master (
ms_id string comment'手动生成主键id',
date_id string comment'日期 2021-08-16',
cur_time string comment'当前时间',
host string comment'stats.mysteel.com	String	nginx	请求HOST (nigx地址)',
user_ip string comment'"180.168.92.26" String nginx 远程地址',
dimensionality string comment'41.8483 long logstash 纬度',
longitude string comment'-87.6517 long logstash 经度',
client_version string comment' "v2.0.1" String app app客户端版本',
channel_id string comment'4405 String app 频道id',
object_id string comment'30905996 String app 获取的文章id',
uid string comment'123 String app 用户id',
source_page string comment' 0011001 String app 上一级跳转页面ID',
pid string comment'101 String app 主体编码',
pro_name string comment' 上海钢联 String app 主体名称',
pro_code string comment'109 String app 产品编码',
fun_code string comment' 0001 String app 功能编码',
fun_name string comment'页面浏览 String app 功能名称',
event_code string comment'101109000100001 String app 事件编码',
event_name string comment' 页面浏览事件 String app 事件名称',
event_property string comment' String app 事件属性完整信息',
type string comment'页面类型sheet String app 页面类型',
request_page string comment'0011002 String app 请求页面id',
stay_time string comment' 145332 String app 打开网页停留的时间长,单位是毫秒',
collect_timing string comment' 毫秒值 string logstash 埋点采集时间,毫秒值',
`timestamp` string comment' 毫秒值 string nginx ngix服务器收集的时间戳',
server_time string comment'“2021-10-01 10:00:00” string 埋点应用 推送数仓时间',
local_time string comment' 毫秒值 String app 客户端本地时间(时间戳)',
machine_code string comment'110011111 String app 设备机器码',
app_channels string comment' 华为商城 (可能拿到值为空) String app APP下载渠道',
source_page_coding string comment' zh-CN String app 网页语言',
network_type string comment'wifi String app 网络类型WiFi 和 有线和2、3、4G',
device_system_type string comment'ios | android String app 系统类型',
device_system_version string comment'7 String app 系统型号',
screen_height string comment'1080 String app 分辨率高',
screen_width string comment'1920 String app 分辨率宽',
authority_location string comment'0:未授权  1:已授权 String app 位置授权',
authority_photo string comment'0:未授权  1:已授权 String app 相册授权',
authority_camera string comment'0:未授权  1:已授权 String app 相机授权',
authority_sms string comment'0:未授权  1:已授权 String app 短信推送授权',
authority_price string comment'0:未授权  1:已授权 String app 价格推送授权',
authority_news string comment'0:未授权  1:已授权 String app 即时新闻推送授权',
authority_comment string comment'0:未授权  1:已授权 String app 评论消息推送授权'
)
STORED BY 'org.apache.iceberg.mr.hive.HiveIcebergStorageHandler'
LOCATION 'hdfs://vm-hc-mysteelRC-cdh01:8020/user/hive/warehouse/hadoop_catalog/ods/app_log_master'
TBLPROPERTIES ('iceberg.catalog'='location_based_table');

直接创建基于hdfs路径的hive-iceberg外部表
'iceberg.catalog'='location_based_table'
LOCATION 设置iceberg table 的hdfs表地址

查询数据

select * from iceberg_ods.app_log_master

用db2查询

db2是链接hs2进行查询,这里需要先重启hs2加载jar包后,然后在hs2里面查询

存在问题

iceberg0.11 中用的hive2.3.7版本
目前公司预发和生产环境用的2.1.1版本
可以在2.1.1版本上创建hive - iceberg 关联表,
可以进行 select * from table 
select count(*) from table
查询,但是如果有 where 条件,查询会报错
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值