EXPORT DATA writes a BigQuery table or query result set to Google Cloud Storage as one or more CSV files.
CSV is universally supported, lightweight, and perfect for spreadsheets or quick data transfers. Exporting directly from BigQuery avoids giving analysts warehouse access while keeping schema fidelity.
EXPORT DATA
streams table or query results to Google Cloud Storage (GCS). You set destination URI, format, delimiter, header option, and compression. BigQuery parallelizes the write, so multiple files may be produced.
EXPORT DATA OPTIONS(uri='gs://bucket/path/file_*.csv', format='CSV') AS SELECT * FROM dataset.Customers;
Select the needed columns inside the SELECT
clause. BigQuery writes only those columns, in the order listed.
Create a scheduled query in BigQuery. Paste your EXPORT DATA
statement, choose a schedule (e.g., daily 02:00 UTC), and ensure the scheduler’s service account has storage.objects.create
permission on the bucket.
compression='GZIP'
to shrink files.*
) in the URI to enable multishard writes.Missing bucket permissions: Grant BigQuery’s service account roles/storage.objectAdmin
or finer-grained write rights.
No wildcard in URI: Without *
, exports larger than 1 GB fail. Add file_*.csv
.
No. BigQuery uses a consistent snapshot, so concurrent queries and writes continue unaffected.
BigQuery generates as many shards as needed for performance. Capture them with a wildcard and combine later if required.