This assumes you will have pgAgent running on the same machine as your database.
- Install pgAgent via package manager
sudo apt update
| #standardsql | |
| with zipcodes as ( | |
| SELECT | |
| zip_census.zipcode as zipcode, | |
| population, | |
| WKT as geometry, | |
| ST_CENTROID(ST_GeogFromText(WKT)) as centroid | |
| FROM | |
| `bigquery-public-data.census_bureau_usa.population_by_zip_2010` AS zip_census | |
| join `bigquery-public-data-staging.zcta_test.2017` as zip_geom |