Skip to content

BigQuery

DataLoris runs checks in BigQuery as a service account you create. Queries run as jobs in the connection’s project and are billed to it, so DataLoris caps the bytes every query may bill.

  1. In the Google Cloud console, open IAM & Admin → Service accounts in the project that will run the queries, and click Create service account. Name it, for example, dataloris.

  2. Grant it exactly two roles:

    Role Why Where
    BigQuery Data Viewer (roles/bigquery.dataViewer) Read table metadata and data for aggregates The project, or only the datasets you monitor
    BigQuery Job User (roles/bigquery.jobUser) Run query jobs The project that runs (and pays for) the queries

    To monitor tables in other projects, grant BigQuery Data Viewer on those projects or datasets too, and keep Job User on the billing project.

  3. Open the service account, go to Keys → Add key → Create new key, choose JSON and download it.

Open Connections, click Add connection and choose BigQuery.

Field Notes
Project ID The project that runs the query jobs (and is billed).
Location Optional. The jobs’ location, such as US or EU, if your datasets are regional.
Service account JSON The whole content of the JSON key. It must be a service_account key for Google Cloud (googleapis.com).
Max bytes billed Optional cap per query, in bytes. Queries that would bill more fail instead of running. When empty, DataLoris uses its default cap of 1 GiB per query.

Save. DataLoris runs a test query (SELECT 1, 0 bytes billed) and the connection turns ACTIVE.

In a suite, click Add asset, choose BigQuery table and enter project.dataset.table. The table’s project can differ from the connection’s project if the service account can read it.

  • Rules on the same table that use the same filters are batched into one query, so a table costs about one scan per run.
  • Rule filters such as a partition column (event_date >= …) reduce the bytes scanned.
  • Table freshness and schema drift read table metadata only: no bytes billed.
  • Custom SQL is dry-run first: it must be a single SELECT and fit within the bytes cap.
  • Profiles of large tables may be sampled to keep costs low.

Every job id starts with dataloris, so you can find DataLoris queries in BigQuery → Job history or INFORMATION_SCHEMA.JOBS.

Error Fix
Access Denied … bigquery.jobs.create Grant BigQuery Job User on the connection’s project.
Access Denied … Table Grant BigQuery Data Viewer on the table’s dataset or project.
Query exceeded limit for bytes billed Raise Max bytes billed, or add a filter so the rule scans less.
Not found: Dataset … was not found in location Set Location to the dataset’s region.
invalid service account JSON Paste the full JSON key of a service account, not an OAuth client file.