Skip to content

Instantly share code, notes, and snippets.

@securetorobert
Created March 24, 2021 16:20
Show Gist options
  • Save securetorobert/65344ec9ee647d581dc77e3d829f2f3d to your computer and use it in GitHub Desktop.
Save securetorobert/65344ec9ee647d581dc77e3d829f2f3d to your computer and use it in GitHub Desktop.
Export bicycle hires to GCS
EXPORT DATA
OPTIONS (format=CSV,
header=TRUE,
uri="gs://bucket/path/rides_*.csv") AS
SELECT
*
FROM
`bigquery-public-data.london_bicycles.cycle_hire`
WHERE
DATE_TRUNC(DATE(end_date), month) >= '2015-08-01'
AND DATE_TRUNC(DATE(end_date), year) < '2017-01-01'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment