🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
đŸ’ŧ Servicesâ„šī¸ Aboutâœ‰ī¸ ContactView Pricing Plansfrom $10

BigQuery Omni: Multi-Cloud & Cross-Cloud Queries

GCP Data EngineeringBigQuery OmniđŸŸĸ Free Lesson

BigQuery Omni: Multi-Cloud Analytics

Master BigQuery Omni for multi-cloud analytics including AWS S3, Azure Blob, cross-cloud queries, and hybrid architectures.

16 min readAdvanced

What You'll Learn

  • 1Explain how BigQuery Omni queries data in AWS and Azure without moving it to Google Cloud
  • 2Create an external connection and an external table over remote storage
  • 3Compare the cost of scanning remote data against copying it into GCS first
  • 4Decide between Omni, replication, and federated queries for a given workload

Most large organisations do not keep their data in one cloud, and the tempting answer, copying everything into BigQuery storage, is often correct but not always. BigQuery Omni exists for the cases where moving the data is slower, more expensive, or less desirable than running the query where the data already sits. This lesson covers how Omni executes, how you point it at remote storage, what it costs, and the criteria that should push you towards consolidation instead.

What problem Omni actually solves

Consider a company that keeps years of clickstream logs in Amazon S3 because the ingestion platform was built there, while the reporting layer lives in Google Cloud. Three options are available. Copy the data into BigQuery, which gives the best query performance and the lowest marginal cost per query, but duplicates storage and adds a continuous pipeline to operate. Query the remote data in place with Omni, which requires no data movement and no second pipeline, but pays a cost per scan on every query. Or export summaries nightly, which is cheap but freezes the analysis at whatever the summary anticipated.

Omni is the middle option, and it wins when the data is large, the queries are infrequent, and the questions were not anticipated in advance. It loses when analysts run exploratory queries all day, because paying for a full scan repeatedly is the most expensive way to answer the same question twice.

How Omni executes

An external connection is the trust relationship between BigQuery and the remote cloud: for AWS it names a role that BigQuery can assume, and for Azure it names the tenant and federated application identity. Once the connection exists, an external table binds a BigQuery schema to a set of remote objects, and the query engine schedules compute next to that data rather than pulling the objects into a Google region first.

Because the compute is placed near the data, the region you choose has to be one where Omni is offered in that cloud, and it should be close to the bucket you are reading. Sending a query from one region to read storage in another adds latency and, depending on the path, transfer charges. The practical rule is simple: place the connection in the same cloud region as the data, and treat the BigQuery metadata project as bookkeeping rather than as a place where the bytes will live.

Creating connections and external tables

The first statement establishes the connection, and the second binds a schema to remote objects. After that, the table behaves like any other BigQuery table to the person writing SQL.

-- Create external connection to AWS
CREATE EXTERNAL CONNECTION `aws_connection`
OPTIONS (
  connection_type = 'AWS',
  connection_properties = '{"aws_properties": {"role_arn": "arn:aws:iam::123456789:role/bigquery-role"}}'
);

-- Create external table for S3 data
CREATE OR REPLACE EXTERNAL TABLE `project.dataset.aws_sales`
WITH CONNECTION `us-central1.aws_connection`
OPTIONS (
  format = 'PARQUET',
  uris = ['s3://my-aws-bucket/sales/**/*.parquet']
);

-- Query across GCS and S3
SELECT 'GCS' as source, COUNT(*) as cnt
FROM `project.dataset.gcs_sales`
UNION ALL
SELECT 'S3' as source, COUNT(*) as cnt
FROM `project.dataset.aws_sales`;

Two details cause most setup failures. The IAM role in the remote cloud must allow BigQuery to read the specific objects, so a bucket policy that only permits the ingestion account will produce access errors that look like configuration bugs. And the schema of the remote files must match what the table declares, which is easy to satisfy with Parquet and easy to get wrong with JSON, where a changed field type surfaces as a query error rather than at creation time.

Formats, partitioning, and performance

Columnar formats are not optional here, they are the difference between a query that reads a few columns and one that reads every byte in every file.

FormatCompressionPredicate pushdownNotes for Omni
ParquetExcellentYesDefault choice, best scan efficiency
ORCExcellentYesEquivalent alternative, good row group statistics
AvroGoodLimitedRow oriented, better for loads than scans
JSONPoorNoFlexible but expensive to scan at scale
CSVPoorNoText, no column pruning, use only for interchange

Partitioning still applies to remote objects, because partitions let the engine skip files rather than scan the whole prefix. Hive style partition paths such as a date directory under the bucket root give the same benefit they give in GCS, and the same discipline applies: a table without partition pruning will be cheap to define and expensive to query.

What Omni costs

The cost model has three components: the compute that runs in the remote region, the bytes each query reads, and any transfer that occurs if you later decide to copy data across clouds. On-demand query pricing charges by bytes processed, so the direct lever is the same one as in ordinary BigQuery, which is reading fewer bytes through projection, partition pruning, and columnar formats.

The indirect lever matters more in practice: how often the same bytes get scanned. A dashboard refreshing every fifteen minutes over an S3 table will bill for every refresh, whereas the same dashboard over native BigQuery storage costs nothing per scan beyond slot time. That is why the crossover point deserves a calculation rather than a preference. Estimate bytes per scan multiplied by scans per day, compare it with the cost of continuous storage plus the pipeline to keep it fresh, and let the numbers decide instead of the architecture diagram.

The job history gives you the raw material for that calculation, since every finished query records how many bytes it billed:

-- Bytes billed per day over the last week
SELECT
  DATE(start_time) AS day,
  ROUND(SUM(total_bytes_billed) / 1024 ** 4, 2) AS tib_billed,
  COUNT(*) AS queries
FROM `region-us`.INFORMATION_SCHEMA.JOBS
WHERE creation_time TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
  AND job_type = 'QUERY'
  AND state = 'DONE'
GROUP BY day
ORDER BY day;

Filter that view down to the external tables you care about by joining the referenced tables column, and you can see within a day whether a reporting pattern is quietly dominating the bill. Teams that run this query once usually discover one or two queries responsible for most of the spend, and the fix is almost always a partitioned copy rather than a stricter rule about what analysts may ask.

When to consolidate instead

Not every multi-cloud dataset belongs in Omni, and recognising the cases where it does not is the interview answer that separates a user from an architect.

Workload characteristicRecommended approachWhy
Infrequent, exploratory, large scansOmni in placeNo pipeline, no duplicated storage
Frequent interactive dashboardsCopy to BigQuery native storageRepeated scans stop billing per query
Regulatory requirement to keep data in regionOmni in placeData never leaves its cloud or region
Need for joins with native BigQuery tablesMixed: small remote table, native factsKeeps the large side cheap to join
Low latency serving or machine learning featuresReplicateServing paths cannot pay scan costs

Common Mistakes

Pointing an external table at unpartitioned JSON files in a bucket root

Fix: Write Parquet with hive style date partitions so queries prune files instead of scanning everything under the prefix.

Building a live dashboard on top of Omni external tables

Fix: Copy the repeatedly queried data into native BigQuery storage and keep Omni for the infrequent questions nobody anticipated.

Ignoring the IAM role and bucket policy when an external table returns access errors

Fix: Grant the connection role read access to the exact prefixes used by the table, and verify with a single row count query before debugging anything else.

Best Practices

  • Place the connection in the same region as the data to avoid latency and transfer charges
  • Use Parquet with partitioned prefixes for every Omni table, and validate schema on a sample file first
  • Calculate the scan cost of your query pattern before committing to Omni over native storage

Key Takeaways

  • Omni runs compute next to remote data, so no copy pipeline and no duplicated storage are required
  • An external connection carries the identity used to read remote objects, and its role must grant prefix level read access
  • Columnar formats and partitioning decide scan cost, which is the dominant charge in Omni
  • Frequent scans over the same remote data usually cost more than copying once, so consolidate when the query pattern repeats

Interview Questions

Q1: What is BigQuery Omni?

BigQuery lets you create external tables over Amazon S3 and Azure storage, with query compute running in regions next to that data. You write standard BigQuery SQL against tables whose bytes never move into Google Cloud storage, which suits large, infrequent, unanticipated analytical scans.

Q2: When would you choose Omni instead of replicating the data?

When data must stay in its original cloud or region, when the queries are infrequent and exploratory, or when no one can predict which fields will be needed. Once the same bytes are scanned repeatedly by dashboards, replication to native storage becomes cheaper and faster.

Q3: What are the cost implications of BigQuery Omni?

You pay for bytes scanned and for compute in the remote region, and potentially for transfer if you later copy data across clouds. There is no per-query saving from caching across separate external tables, so projection, partition pruning, and format choice are the main controls.

Q4: Which formats work best with Omni and why?

Parquet and ORC, because they are columnar, compress well, and support predicate pushdown, so a query reads only the columns and files it needs. JSON and CSV remain readable but force full scans of text, which multiplies the cost of every query.

Q5: What must be configured before an external table can read S3?

An external connection that defines the cloud and identity, an IAM role in AWS with read permission on the target prefixes, and a table definition that names the format and URIs. Most failures trace back to the role or the bucket policy rather than to BigQuery itself.

CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-10-14

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Need Expert GCP Data Engineering Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement