BigQuery
LIVE Destination
Overview
Section titled “Overview”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.
Before you connect
Section titled “Before you connect”- Create the dataset in the location you want (for example
USorEU). - 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.
- BigQuery Data Editor (
- Create a JSON key for the service account and download it.
Connect
Section titled “Connect”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. |
Schema
Section titled “Schema”- 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 type | Destination type |
|---|---|
| integer | INT64 |
| number | FLOAT64 |
| boolean | BOOL |
| object | JSON |
| array | JSON |
| string | STRING |
| string (every value an ISO 8601 timestamp) | TIMESTAMP |
| string (every value an ISO 8601 date) | DATE |
Sync behavior
Section titled “Sync behavior”| 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. |
Common gotchas
Section titled “Common gotchas”- Location must match.
locationmust be the dataset’s location, or jobs fail with Not found: Dataset. MERGEis a billed query. Load jobs are free, but each upsert runs aMERGEthat 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
TIMESTAMPonly if every value in the first extract is an ISO 8601 timestamp; otherwise it staysSTRING. A later extract with a non-timestamp value in aTIMESTAMPcolumn 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
jobUsermakes every load fail with Access Denied: … bigquery.jobs.create.