我是靠谱客的博主 精明音响,这篇文章主要介绍Hive中实现数据增量累加主键覆盖的sql,现在分享给大家,希望可以做个参考。

insert overwrite table full_data_table select

ddd.data_col

from

( select aa.data_col from full_data_table aa

left join

( select b.pk_col as pk_id from full_data_table a

  left join inc_data_table b on a.pk_col = b.pk_col
  
  where b.pk_col is not null and b.date_col = current_date() ) bb
  
on aa.pk_col = bb.pk_id

where bb.pk_id is null

 union all 

select cc.data_col from inc_data_table cc

where cc.date_col= current_date() ) ddd ;

 

 

最后

以上就是精明音响最近收集整理的关于Hive中实现数据增量累加主键覆盖的sql的全部内容,更多相关Hive中实现数据增量累加主键覆盖内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(82)

评论列表共有 0 条评论

立即
投稿
返回
顶部