hive增量表和全量表_hive 拉链表 实现全量数据 增量更新

背景:

数据表字段有IP,IP省份,IP城市,最新访问时间,假如目前一共有100W的IP我第一次初始化的时候完成初始化表插入,然后每天都有5W左右的IP活跃,然后我要更新这5W个IP的记录到初始化的表,他的IP省份如果有变更也要更新保留最新的数据,更新最新的访问时间等。

所有操作均在hive表上

1.需要2个表 数据拉链表,每日更新数据表

DDL语句如下

每日更新表

create table dm.day_tbl(

ip string comment'ip',

country string comment'国家',

province string comment'省份',

city string comment'城市',

day string comment'day',

)

comment '每日更新表'

row format delimited

fields terminated by '\u0001'

stored as parquet;

数据拉链表

create table dm.zipper_tbl(

ip string comment'ip',

country string comment'国家',

province string comment'省份',

city string comment'城市',

t_start_date string comment's

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值