HIVE posexplode 时间区间拆分成单独行

select tf.*,t.*, date_add(start_date,pos) 
from (
  select 'a' as a, '2018-11-01' as start_date, '2018-12-01' as end_date 
) t 
lateral view posexplode(split(space(datediff(end_date,start_date)),' ')) tf as pos,val limit 5000

输出结果:

《HIVE posexplode 时间区间拆分成单独行》

    原文作者:无敌的肉包
    原文地址: https://www.jianshu.com/p/eb85186a4be9
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞