Hive
enoughgood
一条道走到黑
展开
-
在Hive中生成连续的分钟
---生成连续的分钟selectfrom_unixtime(t1.start_time+tab.pos*60) as continue_timefrom( select unix_timestamp('2020-07-27 00:00:00') as start_time ---生成连续分钟的开始时间 ,unix_timestamp('2020-07-27 00:15:00') as end_time ---生成连续分钟的结束时间)t1lateral view pos原创 2021-09-29 10:37:19 · 591 阅读 · 0 评论 -
Hive中生成连续的天,小时,分钟的HQL写法
---生成连续的天selectdate_add(start_date,pos) as dtfrom( select '2021-10-01' as start_date ,'2021-10-15' as end_date)tlateral view posexplode(split(repeat(',',datediff(end_date,start_date)),',')) tab as pos,val;---生成连续的小时selectfrom_unixtime(t1原创 2022-03-15 23:06:20 · 2476 阅读 · 0 评论