问题描述
如何生成包含Dayofweek"、weekofyear"等字段的日期表;行等于从 2010-01-01 到 current_date 的日期如下图:
<块引用>
附言DayofWeek = 一周中的第几天,Sun = 1,Sat = 7Dayofmonth = 该月的第几天
所以我需要做的第一步可能是创建从 2010-01-01 到 current_date 的记录,我想知道 hive 和 mssql 中的 while 循环会做什么?然后我准备好了专栏最后将它们结合起来.
我试过了
Hive 解决方案:
添加更多假期.
How can i generate a Date table with fields like "Dayofweek", "weekofyear" etc ;and rows equals to date from 2010-01-01 till current_date like below:
P.S. DayofWeek = day num of the week, Sun = 1, Sat = 7 Dayofmonth = day num of the month
So first step i need to do may be create records from 2010-01-01 till current_date, i wonder while loop in hive and mssql will do? Then I have the column ready Finally combine them.
I have tried
Solution for Hive:
Add more holidays.
这篇关于如何生成字段等于“Dayofweek"、“weekofyear"的日期表?等;行等于从 2010-01-01 到 current_date 的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!