Last active
March 18, 2019 12:51
-
-
Save skipperkongen/70cd738534f48abf16d4e0c8d38c3667 to your computer and use it in GitHub Desktop.
Select next weeks with year in Spark SQL
This file contains hidden or 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 | |
year(dt) as departure_year, | |
weekofyear(dt) as departure_week | |
from ( | |
select date_add(current_date(), x) as dt | |
from `table_that_contains_integers_0_to_n_as_x` | |
where x % 7 = 0 | |
) | |
order by dt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment