Skip to content

BigQuery

LIVE Destination

PortPilot loads each synced table into a BigQuery table in the dataset you choose, using BigQuery load jobs (which are free) with an explicit schema, so column types stay stable between syncs. Changed rows are merged on the primary key with a MERGE query. Tables and new columns are created automatically.

  1. Create the dataset in the location you want (for example US or EU).
  2. Create a service account in the dataset’s project and grant it:
    • BigQuery Data Editor (roles/bigquery.dataEditor) on the dataset;
    • BigQuery Job User (roles/bigquery.jobUser) on the project.
  3. Create a JSON key for the service account and download it.

In the app, go to Destinations → New destination → BigQuery and click Test connection after filling in:

Field Required Default Description
project_id Yes — Google Cloud project that holds the dataset.
dataset_id Yes — Target dataset.
credentials_json Yes — The service account’s JSON key, pasted whole. Stored write-only.
location No US The dataset’s location, e.g. US, EU, asia-northeast1.
  • Tables are named after the source table or stream and created on the first load. Table and column names keep the source spelling.
  • Column types come from the schema PortPilot records for each extract, not from BigQuery's autodetect. All columns are NULLABLE.
  • New columns are added on later loads. Existing columns are never changed or dropped.
  • No PortPilot metadata columns are added.
PortPilot typeDestination type
integerINT64
numberFLOAT64
booleanBOOL
objectJSON
arrayJSON
stringSTRING
string (every value an ISO 8601 timestamp)TIMESTAMP
string (every value an ISO 8601 date)DATE
Write mode When What happens
Upsert Tables with a primary key Rows load into a temporary table, then MERGE into the target on the primary key. The temporary table is always deleted.
Replace Full reads of tables without a primary key Load job with WRITE_TRUNCATE.
Append Incremental reads of tables without a primary key Load job with WRITE_APPEND.
  • Location must match. location must be the dataset’s location, or jobs fail with Not found: Dataset.
  • MERGE is a billed query. Load jobs are free, but each upsert runs a MERGE that scans the target table. On large tables, partition or cluster on the primary key or a date column to cut bytes scanned.
  • Timestamp detection is all-or-nothing. A column becomes TIMESTAMP only if every value in the first extract is an ISO 8601 timestamp; otherwise it stays STRING. A later extract with a non-timestamp value in a TIMESTAMP column fails that table’s load.
  • Tables created by older PortPilot versions were typed by BigQuery’s autodetect. If a load fails on a column type mismatch, drop the table (or the column) and let the next sync recreate it.
  • Missing jobUser makes every load fail with Access Denied: … bigquery.jobs.create.