Created
December 27, 2016 21:05
-
-
Save alexvanboxel/0acdc74465ef1a27878c8b70841cf24b to your computer and use it in GitHub Desktop.
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
#standardSQL | |
SELECT | |
..., | |
station.lon AS station_longitude | |
FROM | |
`bigquery-public-data.noaa_gsod.gsod{{execution_date.year-8}}` AS gsob | |
JOIN | |
`bigquery-public-data.noaa_gsod.stations` AS station | |
ON | |
CAST(gsob.stn AS INT64)=station.usaf | |
AND CAST(gsob.wban AS INT64)=station.wban | |
WHERE | |
CAST(CONCAT(CAST((CAST(year AS INT64) + 8) AS STRING),'-',CAST(mo AS STRING),'-',CAST(da AS STRING)) AS DATE) | |
= '{{ ds }}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment