Last active
September 15, 2016 13:13
-
-
Save kyoro1/aeb2335c7a8e760ec4a91a45f4687495 to your computer and use it in GitHub Desktop.
Hive関数で週番号を取得 ref: http://qiita.com/kyoro1/items/b4efa6a6da7573498f95
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
weekofyear("yyyy-mm-dd") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select weekofyear("1970-11-01") | |
---44 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select weekofyear("2016-09-11") | |
---36 <- 日曜 | |
select weekofyear("2016-09-12") | |
---37 <- 月曜 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select weekofyear('2015-12-28') | |
--- 53 <- 月曜 | |
select weekofyear('2016-01-01') | |
--- 53 <- 木曜 | |
select weekofyear('2016-01-03') | |
--- 53 <- 日曜 | |
select weekofyear('2016-01-04') | |
--- 1 <- 月曜 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select weekofyear(from_unixtime(unix_timestamp('20151228','yyyymmdd'), 'yyyy-mm-dd')) | |
--- 53 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment