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 时间区间拆分成单独行_第1张图片

你可能感兴趣的:(HIVE posexplode 时间区间拆分成单独行)