How to export your data from Google BigQuery: what leaves and what stays
If a renewal, a pricing change or a residency requirement is pushing you off BigQuery, start by knowing what the export can and cannot carry. Tables leave BigQuery only through Cloud Storage. You run an extract job, the bq extract command or the console, or you run an EXPORT DATA statement for query results. Local files, Google Sheets and Google Drive are not supported destinations, so every exit path begins with a bucket you control or can grant access to, and that bucket becomes part of your data residency story.
The format decision carries most of the downstream work. CSV exports support only GZIP compression and cannot hold nested or repeated fields, so tables with STRUCT or ARRAY columns need JSON, Avro or Parquet. BigQuery writes up to 1 GB of logical data per file, and larger exports use a single wildcard after the bucket name, which BigQuery replaces with a zero-padded sequence number. Check that your downstream loader reads multi-file output and that the file count is manageable for your bucket and pipeline. Confirm current limits and supported compression for each format in the BigQuery export documentation before you script anything.
Be clear about what the export does not move. It copies table data, not GoogleSQL logic, views, scheduled queries, IAM grants, row-level or column-level policies, or dataset-level settings. Those must be inventoried and rebuilt on the target side, and they are often the hardest part of the cutover. Plan a short inventory of views, scheduled queries and consumers before the first export, so the data copy is not mistaken for a complete migration.
Which BigQuery data types export and with which method
This table shows which export method and file format fit each kind of BigQuery table or query result, and whether nested and repeated fields survive the export. Read it before scripting an export, because CSV drops nested data and every export must land in Cloud Storage.
| Export item | Method and destination | Formats and nested data support | Size and file rules |
|---|---|---|---|
| Table data (console or bq extract) | Console export or bq extract, or an extract job, written to a Cloud Storage bucket | CSV (GZIP only), JSON, Avro or Parquet; CSV cannot hold nested or repeated fields | Up to 1 GB of logical data per file; larger exports use one wildcard in the object name |
| Query results (EXPORT DATA) | EXPORT DATA statement writes query output directly to Cloud Storage | Same format choices as extract jobs; use JSON, Avro or Parquet to keep nested and repeated columns | Same 1 GB per file rule; add the wildcard for larger result sets |
| Nested and repeated columns | Extract job or EXPORT DATA with JSON, Avro or Parquet | Supported in JSON, Avro and Parquet; flattening is required for CSV | Confirm column types in the target system after the export |
| Local files, Google Sheets, Google Drive | Not supported as export destinations | Not applicable | Export to Cloud Storage first, then download the objects |
| Large tables above 1 GB | Wildcard in the destination URI, such as one asterisk after the bucket name | Format choice unchanged; each file is numbered with a zero-padded sequence | BigQuery replaces the wildcard with sequence numbers; plan downstream loaders to read all parts |
| High-volume bulk reads | Storage Read API as an alternative path, not a file export | Streams rows to a client rather than writing files | Free tier of 300 TiB read per month per billing account, excluding outbound transfer; confirm egress costs with Google Cloud |
Choosing a format that keeps nested data intact
CSV cannot carry nested or repeated columns, so a table with RECORD fields or arrays has to be flattened or exported in a different format. BigQuery supports only GZIP compression for CSV exports, and CSV exports do not support nested or repeated data. JSON, Avro and Parquet exports do support nested and repeated data, so these are the formats to check first for any table that uses structs or arrays. Before you run the export, list the tables in the dataset whose schema includes RECORD or repeated fields, and decide the format for each group separately. Flat reference tables can stay in CSV if your target tooling reads them easily.
The target engine shapes the choice more than the export does. For a ClickHouse load through the gcs table function, or an Iceberg table in a Trino lakehouse, confirm with the vendor documentation which of JSON, Avro and Parquet the loading path reads with the nested types you need, and test it on a sample export before you export the full dataset. Parquet is usually the most compact and columnar of the three, but it is not the only option, and compression settings differ by format. Avoid assuming that a format which exports nested data will also load nested data without changes to the target schema.
The practical trade-off is between re-load effort and file size. CSV files are easy to inspect and reload with simple tools, but they lose nested structure and need flattening logic on both sides. JSON is readable and keeps structure, but it is typically larger and slower to parse at scale. Avro and Parquet keep structure and compress well, but they need tooling that reads them. Record the format, compression and schema for every exported table in your migration inventory, so the reload step uses the same definitions that the export produced.
What BigQuery will not export directly and the workarounds
BigQuery's export path is narrower than most teams expect. Table data goes to Cloud Storage only, and several things that look like data, such as views and grants, do not travel in an export at all. The cards below cover the destinations you cannot use, the workarounds for each, and the objects you must rebuild by hand.
Local files, Sheets and Drive
BigQuery cannot export to a local file, Google Sheets or Google Drive. Any data that a team currently downloads from the console or copies through a spreadsheet has to be staged first. The workaround is a Cloud Storage bucket that your team controls, with retention, region and access policies set before the first export. Check who holds the bucket permissions, because the exported files will contain the full table contents.
Export docsQuery results need EXPORT DATA
Extract jobs move whole tables, but a filtered or joined result set has to be written with the EXPORT DATA statement, which sends the query output to Cloud Storage. Use it when you need a subset, such as one customer segment or one month. Note that the query is billed as a normal query, so a wide scan costs the same as it would on the dashboard that reads it.
Storage Read API for pipelines
Pipelines that read BigQuery directly can use the Storage Read API instead of exporting files. The free tier covers 300 TiB of bytes read per month per billing account, and outbound data transfer is billed separately, so the cost depends on where the reader runs. Confirm the transfer charges for your region and your self-hosted destination before you choose this path for bulk copies.
BigQuery pricingViews and scheduled queries
Views, materialized views and scheduled queries are definitions, not table data, so an export does not carry them. Each one has to be rewritten as SQL in the target engine, then tested against the same results. Inventory them from the dataset listings before cutover, and record which downstream dashboards and jobs depend on each one.
IAM grants and dataset settings
Access grants, dataset labels, default table expiration and location settings stay behind in BigQuery. Recreate them in the target system as access rules, retention settings and labels, and confirm that the new groups match the old ones. Exporting the rows without these settings can leave data readable by the wrong people or deleted on the wrong schedule.
The export sequence, from inventory to verified copy
This sequence moves BigQuery tables into Cloud Storage as files you can load into a self-hosted engine, and it ends only when each table's copy has matched its source on file count, row count and checksums. Nothing in BigQuery should be deleted until that match is recorded.
Inventory datasets, tables and scheduled consumers
The data platform owner lists every dataset, table, view, scheduled query and external consumer in the project, with approximate logical size and row count from the table metadata. Record which tables hold nested or repeated columns, since that decides the export format in a later step. The step is complete when the inventory is signed off by the data owners and each table has a row count recorded from BigQuery, which becomes the baseline for verification. Views are noted but not exported, because their definitions must be rewritten for the target engine.
Choose an export format for each table
The engineer assigns a format per table. Tables with nested or repeated fields should use Parquet, Avro or JSON, because CSV exports support only GZIP and no nested or repeated data. Flat tables can use CSV if the target loader prefers it, though Parquet is usually the simpler choice for columnar engines. The step is complete when each table in the inventory has one format and one compression setting written into the migration plan. Confirm the chosen format is read correctly by the target engine on a small sample before running full exports.
Create the Cloud Storage bucket and restrict access
The cloud administrator creates a dedicated Cloud Storage bucket in a location chosen for the data residency requirement, and grants the export identity write access only to that bucket. Read access is granted to the engineer who will load the files into the self-hosted platform, and nothing else. Confirm that the bucket is the only export destination in use, since BigQuery supports Cloud Storage alone for exports. The step is complete when access has been tested with a one-table export and the bucket's access policy has been reviewed by the security team.
Run extract jobs or EXPORT DATA by table
The engineer runs a table extract job from the console, the bq extract command or the extract API, or runs an EXPORT DATA statement for query results. BigQuery can export up to 1 GB of logical data to a single file, so any table larger than that must use a single wildcard after the bucket name, which BigQuery replaces with a zero-padded sequence number. Run tables one at a time at first and record the job ID and the output path for each. The step is complete when every job reports success and the job log lists every file written.
Confirm file counts against the export job
The engineer lists the objects under each table's prefix in the bucket and compares the count with the number of files the export job reports. For sharded exports, the sequence numbers should run without gaps from zero. Any mismatch, missing sequence number or zero-byte file blocks the table and triggers a rerun of that table only. The step is complete when each table shows matching file counts in a recorded check. This confirms that the transfer is complete but not yet that the data is correct.
Reconcile row counts and checksums
After the files are loaded into a staging table on the target platform, the engineer compares the row count with the baseline recorded in the inventory. For a sample or each table, the engineer also compares a column-level aggregate or a hash of key columns between BigQuery and the target. Nested fields need an explicit check, because a flattened or mis-typed column can keep row counts correct while corrupting values. The step is complete when every table has a row count match and a documented checksum or aggregate match, with any differences explained and resolved.
Store the verified copy and keep the source
The data owner signs off on each table's verification record, and the verified files are stored in a second location, such as the self-hosted object store, with retention and access controls set by the governance team. The BigQuery source is kept unchanged until the migration is accepted, and any deletion of source tables or the Cloud Storage export files is a separate, approved change. The step is complete when the verification records and retention decisions are filed together. Confirm with your compliance team which records must be retained for each dataset before any deletion is scheduled.
How data moves from BigQuery to your own storage and engine
The flow starts with BigQuery tables, which leave through either an extract job or an EXPORT DATA statement. Cloud Storage is the only destination, so the bucket you control is the trust boundary: once data lands there, it is yours to protect and govern. From the bucket, a self-hosted ClickHouse server loads files with the gcs table function, or a Trino cluster lands them as Iceberg tables. Check the format and compression chosen at export, nested field handling, and the file splitting for large tables before you load.
Export paths from BigQuery to a customer-controlled bucket, then into self-hosted engines.
Verifying the export depends on where the data lands
When the exported files are loaded into ClickHouse, the usual route is the gcs table function, which reads the Parquet, Avro or JSON files straight from the bucket. Verification starts at the source. Before you trust the copy, record row counts for each table in BigQuery and compare them with counts from the same files read through ClickHouse, then run a set of sample queries on both sides and compare the results. Nested and repeated columns deserve their own sample queries, since their flattening is where most differences tend to appear. Confirm the exact function signature and supported formats in the ClickHouse documentation for your version, and check that the files you loaded are the complete set, including every shard of a wildcard export.
- Row counts per table: Compare totals from BigQuery with totals from the loaded ClickHouse tables, and record the query and timestamp used.
- Sample queries: Run the same aggregates (sums, distinct counts, min and max dates) against both systems for each business-critical table.
- Nested data: Check that structs and arrays from JSON, Avro or Parquet exports map to the intended ClickHouse column types.
- Wildcard file completeness: Confirm that every numbered file produced by a wildcard export was read, with no gaps in the sequence.
- Repeatable checks: Keep the queries in version control so the same comparison can run again after each reload.
Confirm the detailed checks, tolerances for floating-point columns and sign-off steps with your data owners in your own environment before cutover.
When the export lands as Iceberg tables queried through Trino, the object storage files are only part of the picture. The Iceberg metadata decides which files belong to the table, so verification covers the file inventory, the schema and the snapshot history. Compare the files Iceberg references with the files BigQuery wrote, then compare the table schema with the BigQuery schema, paying attention to nested fields, timestamps and decimal precision. Trino's Iceberg connector supports time travel, which gives you a documented way to inspect earlier table states during testing. Treat this as a starting list and confirm the checks against the Trino and Iceberg version you run.
- File inventory: List the data files Iceberg references for each table and compare the count and total size with the BigQuery export manifest.
- Schema comparison: Match column names, nested field structure, types and nullability against the BigQuery table definition.
- Snapshot checks: Use the snapshot history to confirm that the load produced the expected snapshot and that no unintended commits followed it.
- Row counts and aggregates: Run the same totals and sample queries against Trino and BigQuery, using the Iceberg time travel syntax to pin a comparison to a known state.
- Catalog consistency: Confirm that the catalog your Trino cluster uses points at the same metadata location as the loading job.
Confirm the catalog type, retention settings for old snapshots and the exact Trino release behavior in your own environment before you delete any source data.
Security and compliance reviewers usually want a record that the copy matches the source, not only a passing query. Whichever target you choose, keep the same kind of evidence: what was exported, from which tables, at what time, with which format and compression, and what comparison was run afterward. Store the BigQuery export job details, the file listings in Cloud Storage and the verification query outputs together, so an auditor can follow one table from source to target. Access to the exported files and the target should be restricted to the people who need it, and the bucket permissions used during export should be reviewed once the migration is complete.
- Export record: Keep job identifiers, timestamps, formats, compression settings and the list of files for each table.
- Comparison results: Save the row count and sample query outputs from both systems, with the query text included.
- Access review: Record who can read the export bucket and the target tables, and remove temporary grants after cutover.
- Exceptions log: Document any table that differs, the cause and the decision taken.
- Retention decision: Note how long the exported files are kept and when they are deleted.
Ask your auditors which evidence format they accept, and confirm with your security team how long exported copies may remain in Cloud Storage.
Export questions buyers ask before hiring outside help
How much effort does a full BigQuery export take?
Effort depends mainly on how many tables and datasets you have, how much logical data they hold, and whether they contain nested or repeated fields. Each table is one export job or query, so a warehouse with hundreds of tables means hundreds of jobs to script, schedule, check and log. Nested data pushes you toward JSON, Avro or Parquet, which are the formats that support it, and tables above the 1 GB per file limit need wildcard file names and a file manifest your loader can read. Ask any outside team to size the work from a table inventory with row counts, logical bytes and schema depth, and to state which tables are excluded from scope.
Can our team run the BigQuery export with the bq CLI ourselves?
Yes, for most datasets your engineers can do it with the bq command-line tool or the console, because BigQuery exports table data through bq extract, extract jobs and the EXPORT DATA statement for query results. The steps are simple to run but easy to get wrong at scale: choosing the destination bucket, setting the wildcard for large tables, keeping compression consistent with the target format, and recording which exports completed. The harder parts are verification, schema fidelity for nested fields and repeatable scheduling, which is where many internal teams ask for help. Your team can export a pilot dataset first to judge the effort before deciding who runs the rest.
What access does an export need from our Google Cloud project?
The export runs under an identity with permission to read the source tables and write to a Cloud Storage bucket, and it must be billed to a project with an active billing account. In practice you need read access to the datasets, permission to create extract jobs or run EXPORT DATA in the project, and object write permission on the destination bucket. Confirm these roles with your Google Cloud administrator and the BigQuery documentation before work starts, and decide whether the bucket is in the same location as the dataset, since cross-location copies add data transfer considerations. Keep the bucket private and encrypted under your key policy so the export does not create a new exposure.
Does exporting from BigQuery cost money in query charges?
Table extract jobs and exports are not billed as queries, but a query that writes results with EXPORT DATA runs like any other query and is billed under BigQuery's compute pricing. Storage used in the bucket is billed by Cloud Storage, and moving data out of Google Cloud can add network egress charges. Check the current BigQuery pricing page for query and storage rates, and confirm the extract job and egress treatment for your region and destination. Ask the team you hire to list each charge by service, separate one-time copy costs from recurring storage, and estimate egress from the logical bytes you plan to move.
How long does the export take?
The duration depends on total data volume, the number of export jobs that can run in parallel, the chosen format and compression, and the throughput between Google Cloud and your destination. No fixed duration applies across datasets, so the reliable approach is to time a representative pilot and extrapolate from its bytes per hour. Large tables split across many wildcard files run faster than one oversized write, and exports should run during a window when source tables are not changing, or you will need a change capture step to reconcile late rows. Ask for the timing measurement and the assumptions behind any schedule in a written plan.
Do we need a consultant to verify the exported data?
You do not strictly need one, but verification is the step most often skipped and the one that causes the most trouble later. A reasonable check compares row counts, column counts, checksums or aggregate totals for each table, and confirms that nested and repeated fields came through with the expected structure. DeployOpen plans, implements and documents self-hosted platforms in your own infrastructure, and can run the export, reconciliation and evidence collection under a fixed-scope written agreement, while your team keeps ownership of the results. Independent auditors, not DeployOpen, issue any audit reports, so ask whether the evidence you need will satisfy your compliance reviewers.
What to plan before the BigQuery contract ends
These six decisions shape how much risk the export carries. Most of them are cheap to settle early and expensive to discover during cutover, so record each one in the migration plan before the contract notice date.
Take a full export before cancellation
Export every table you need to keep to Cloud Storage while the project still works, using extract jobs or EXPORT DATA. Start with the largest and most frequently queried tables, since they take longest to move. Record the export job IDs, row counts and checksums so you can compare them with the copies you load later.
Export docsKeep the source readable until verification passes
Do not delete or disable datasets until the destination copies match the source on row counts and sampled values. Keep BigQuery readable until verification is signed off, because a failed load is easy to repair only while the original data still exists. Ask your contract owner whether reads stay available after the notice date.
Inventory scheduled queries and views
List every scheduled query, view, materialized view, routine and external connection that reads the tables you are moving. Each one is a silent dependency that will break at cutover if it is missed. Note the owner, the schedule and the downstream dashboard or pipeline for each item.
Record IAM and dataset settings
Export the IAM bindings, service accounts, dataset labels, access controls and any customer-managed encryption key references for each dataset. These settings tell you who read the data and under which identities, which your new platform must reproduce or replace. Store the record with the migration evidence.
Confirm the Cloud Storage retention period
Check the bucket's retention policy, object versioning and lifecycle rules before writing exports. A lifecycle rule that deletes objects after a short period could remove your only copy before the load finishes. Confirm the bucket location and who can read the exported objects, and keep them until the target platform has passed its restore tests.
Set a dated cutover plan
Agree a written schedule with named owners for export, load, query rewrites, BI repointing, parallel runs and the final switch. Set the date for stopping writes to BigQuery and the date after which the project is no longer used. Keep the plan short enough that the team can follow it during the cutover window.
Where the exported files can land on a self-hosted stack
Exported files can land in two main places on a self-hosted stack. The first is ClickHouse server, which is open source under Apache-2.0. After the files are in your own bucket, the gcs table function can read them directly, so you can load Parquet or Avro into MergeTree tables without a separate staging engine. Before you commit to that path, check that your table design fits ClickHouse. Primary keys and partitions are chosen for query patterns, not copied from BigQuery clustering, and nested columns will need a deliberate mapping. Confirm the exact function arguments and supported formats against the ClickHouse documentation for the version you plan to run.
The second option is Trino (Apache-2.0) with an Iceberg REST catalog or a Hive Metastore. Trino does not store the data it queries. It reads through connectors, so the exported files need separate object storage, and a table catalog must record what each table is and where its files sit. This means a self-hosted lakehouse is three components to plan, size, back up and secure: object storage, a catalog and the Trino cluster itself. Decide early which catalog you will run, who owns its access control, and how Iceberg tables will be created from the exported Parquet or Avro files. The Trino Iceberg connector documentation lists the catalog types it supports. For the full move, including schema translation, query rewrites and result checks, use the migration pages under this topic.
How DeployOpen scopes and delivers a BigQuery data exit
DeployOpen treats a BigQuery export as a scoped engagement: the tables, formats and destination are agreed in writing before any job runs. The work covers the Cloud Storage export path, the files that land there, and the checks that confirm the data is complete and readable on your own infrastructure.
How we scope
- Inventory the datasets, tables and nested columns that must leave BigQuery, with row counts and sizes confirmed in your project.
- Agree the export format and compression per table, noting that CSV exports cannot carry nested or repeated data.
- Record the Cloud Storage bucket, naming pattern and access controls in the written scope before any extract job starts.
How we build
- Run extract jobs or EXPORT DATA statements in your environment, using wildcard file names for exports above the 1 GB per file limit.
- Verify exported files against source row counts and schemas, including nested fields in JSON, Avro or Parquet output.
- Test the Storage Read API as an alternative path where a streaming read suits a table, and document its billing terms as they apply to your account.
How we hand over
- Deliver an export runbook with the commands, job settings and file layout used for each table set.
- Provide a reconciliation report showing row counts, checksums and any tables that needed a different format or split.
- Document the restore path into ClickHouse or an Iceberg lakehouse so your team can load the files without DeployOpen present.
How we support
- Fixed-scope delivery means timelines and deliverables are set in writing before work begins, with a quote following from that scope.
- Ongoing support, upgrades and continuous testing are available as a retainer if exports must repeat or your target platform changes.
- Ask any provider to confirm in writing who pays for Cloud Storage, egress and BigQuery job charges during the export window.

