Skip to content
Reference

Adapter: Google BigQuery

Insert rows into a BigQuery table, run a parameterized GoogleSQL query, or poll a query with a cursor (Workload Identity or a service account key).

On this page

Purpose

Stream workflow output into an existing BigQuery table or upsert it by key (one MERGE on the columns you name, so replays never duplicate a row), run a parameterized GoogleSQL query and pass the rows to the next step, or read new rows on a schedule as the reader of a polling trigger. It is for healthcare organizations that keep their warehouse in BigQuery. See Google BigQuery for setup, duplicates and access.

Auth

  • workload-identity (default): the engine's own Google service account on GKE, with no stored key. service-account-key: a stored JSON key, for an engine outside GKE. The token is cached and fetched again once after a 401; a second 401 fails the step.
  • Upsert needs roles/bigquery.dataEditor on the dataset (Terraform's edit) and roles/bigquery.jobUser on jobProject: it runs a MERGE job.
  • Insert needs bigquery.tables.updateData, bigquery.tables.get and bigquery.datasets.get on the dataset (the Terraform module's insert-only custom role; roles/bigquery.dataEditor also works but can read rows and delete tables). Query and poll need roles/bigquery.dataViewer on the dataset and roles/bigquery.jobUser on jobProject (default project).
  • It takes the shared connection options for its BigQuery requests. A service account key's token exchange does not go through the proxy, and the profile shows a warning when both are set; use Workload Identity behind a proxy. With workload-identity a profile CA (tlsCaPem) is refused: the requests carry the engine's own Google token, so they are verified against the system CAs only.

Settings

Auth is chosen with authType: workload-identity, service-account-key (default workload-identity). Dotted names are fields inside an object setting. Secret settings are encrypted at rest, never returned by a read, and shown masked in the console and in exports; their defaults are not shown.

SettingTypeRequiredDefaultSecretDescription
projectstringYesNoGoogle Cloud project ID that holds the dataset.
datasetstringYesNoBigQuery dataset ID, e.g. clinical_rows.
jobProjectstringNoNoProject where query, poll and upsert jobs run and are billed. Defaults to project; set it for a separate billing project or a VPC Service Controls perimeter.
locationstringNoNoDataset location for query, poll and upsert jobs (US, EU, europe-west2). Sent only when set.
authTypeenum: workload-identity, service-account-keyNoworkload-identityNoworkload-identity: the engine's own Google service account (GKE), no stored key. service-account-key: a stored JSON key, for an engine outside GKE.
credentialsobjectNo
credentials.serviceAccountKeystringNoYesService account JSON key (encrypted at rest). Used when authType is service-account-key.
maximumBytesBillednumberNo10737418240NoMost bytes one query, poll or upsert job may bill; a bigger job fails without running (default 10 GiB).
kmsKeyNamestringNoNoCustomer-managed key (CMEK) for query result tables: projects/P/locations/L/keyRings/R/cryptoKeys/K.
timeoutnumberNo30000NoTimeout for each HTTP request in milliseconds.
queryTimeoutMsnumberNo120000NoLongest wait for a query or poll job to finish, in milliseconds.
tlsCaPemstringNoYesPEM CA certificate(s) to verify the server against. See tlsCaMode.
tlsCaModeenum: replace, addNoNoTrust: replace = only this CA (default), add = the system CAs plus this CA. Needs tlsCaPem.
tlsClientCertPemstringNoYesPEM client certificate, for servers that require mutual TLS. Set with tlsClientKeyPem.
tlsClientKeyPemstringNoYesPEM private key for the client certificate (encrypted at rest).
tlsClientPfxstringNoYesClient certificate and key as a base64 PKCS#12 (.p12 / .pfx) bundle, instead of the PEM pair.
tlsClientPassphrasestringNoYesPassphrase of the PKCS#12 bundle.
tlsMinVersionenum: TLSv1.2, TLSv1.3NoNoLowest TLS version to accept (default TLSv1.2).
proxyUrlurlNoNoHTTP(S) proxy, e.g. http://proxy.example.test:3128 (opens in a new tab). The proxy host must pass the SSRF rules (SSRF_ALLOWLIST for a private one).
proxyUsernamestringNoNoProxy user (Basic auth).
proxyPasswordstringNoYesProxy password.
noProxyarray of stringNoNoHosts sent direct, not through the proxy: a name (and its subdomains), .suffix, host:port or *.

Actions

A trailing ? marks an optional step parameter. A message can supply only the keys in the last column; everything else comes from the step.

ActionWhat it doesStep parametersKeys a message may supply
insertStream rows into an existing table (tabledata.insertAll), with a retry-stable insertId per row.table, rows?, onRowError?, ignoreUnknownValues?, rowIdColumn?, jsonColumns?, checkSchema?rows
upsertUpsert by key: one parameterized MERGE on the key columns, so a resend or replay never duplicates a row; rows are checked against the table first.table, keyColumns, rows?, ignoreUnknownValues?, maxConcurrentMerges?rows
queryRun one GoogleSQL statement with :name or @name parameters; returns rows.sql, params?, paramTypes?, maxRows?params
pollPolling trigger read: a query using :cursor and :limit, one message per row.sql, cursor?, cursorInitial?, limit?, params?, paramTypes?None

Minimal example

The smallest profile the engine accepts: the required settings only, with synthetic values. Create it with POST /api/adapter-profiles, then test it with POST /api/adapter-profiles/{id}/test.

json
{
  "name": "Google BigQuery (example)",
  "adapterType": "bigquery",
  "config": {
    "project": "demohealth-prod",
    "dataset": "clinical_rows"
  }
}

Limits

  • An insert takes at most 10,000 rows and 9.5 MB. A bigger batch fails before anything is sent; split it with a loop or a batch transform. The adapter never splits a batch for you.
  • Each row gets an insertId that stays the same across the step's retries, so BigQuery drops a retried row for about 60 seconds. A replay or a new execution gets new IDs, so it is not deduplicated. See Duplicates, retries and replays.
  • The table must exist: the adapter creates no tables or datasets, and the table, dataset and project come from the profile and the step, never from a message.
  • An upsert checks every row against the table's columns before its MERGE, and an insert does with checkSchema: true: an unknown field, a missing REQUIRED column or a missing key value fails the step naming the row number and the column, never a value. Otherwise BigQuery reports a bad inserted row by row number, reason and column, and nothing else. With onRowError: fail (default) nothing lands; with skip the good rows land and the bad ones come back as failedRows.
  • An upsert sends its rows as one typed query parameter and matches on keyColumns; a retry, resend or replay of the same rows leaves one row per key. DML contention on the table (a full DML queue, a concurrent update, a DML quota) is retried after a randomized wait, and each engine replica runs at most maxConcurrentMerges (default 1) MERGEs at once per table. For a high-volume feed, put a Collector before the upsert so a whole window is one MERGE; see High-volume feeds. See Upsert by key.
  • Send a JSON column's value as a string (JSON.stringify), and an INT64 or NUMERIC value above 2^53 as a string.
  • Every query and poll job carries maximumBytesBilled (default 10 GiB). A job that would scan more fails without running.
  • A query returns at most maxRows rows (at most 10,000, default 1,000) and reports truncated when there were more. A poll returns at most limit rows (at most 10,000, default 100); keep limit above the number of rows that share one cursor value.
  • The SQL is one GoogleSQL query (SELECT, WITH or FROM first); DML, DDL and scripts are refused. Values are bound as :name or @name parameters, never pasted into the SQL; {{...}} templates and positional ? are refused.

Reference