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
输出结果:
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
输出结果: