生辰数字
select posexplode(split(repeat("o", datediff("2022-12-31", "2022-12-16")), "o"))
生成日期
with dates as ( select date_add("2012-01-01", a.pos) as d from ( select posexplode(split(repeat("o", datediff("2022-12-31", "2012-01-01")), "o"))) a ) select d as date_id , weekofyear(d) as week_id , if(`dayofweek`(d) = 1, 7, `dayofweek`(d) - 1) as week_day , dayofmonth(d) as day , month(d) as month , quarter(d) as quarter , year(d) as year from dates order by d;
标签:dayofweek,12,datediff,Hive,生成,日期,01,2022,select From: https://www.cnblogs.com/wind-man/p/17027898.html