Google Cloud Storage
BUILDING Destination · built and tested, not yet verified against production accounts. Contact us before relying on it.
Overview
Section titled “Overview”PortPilot writes each synced table to your Cloud Storage bucket as gzipped JSON Lines files, one file per table per sync, in Hive-style date partitions. Use it as a data lake landing zone, or query the files with BigQuery external tables, Snowflake or Databricks.
Before you connect
Section titled “Before you connect”-
Create or pick a bucket.
-
Grant write access on the bucket with a role that includes
storage.objects.create,storage.objects.listandstorage.objects.delete, such as Storage Object Admin (roles/storage.objectAdmin) scoped to the bucket. Grant it to one of:- Your PortPilot job’s service account (hosted or GCP BYOC). Leave
credentials_jsonempty. Contact us for the hosted service account’s email. - A service account of your own, with a JSON key pasted into
credentials_json.
storage.objects.deleteis only used by full-refresh tables (see below). - Your PortPilot job’s service account (hosted or GCP BYOC). Leave
Connect
Section titled “Connect”In the app, go to Destinations → New destination → Google Cloud Storage and click Test connection after filling in:
| Field | Required | Default | Description |
|---|---|---|---|
bucket |
Yes | — | Bucket name. |
prefix |
No | — | Object prefix inside the bucket, e.g. portpilot/. |
credentials_json |
No | — | Service account JSON key. Leave empty to use the job’s own service account. Stored write-only. |
Schema
Section titled “Schema”- Each source table or stream gets its own folder, named after it.
- Gzipped JSON Lines, one file per table per sync:
<prefix><table>/dt=YYYY-MM-DD/<run_id>.jsonl.gz. <prefix><table>/_schema.jsonholds the latest columns, types, primary key and cursor.- Values keep their JSON types: nested objects and arrays stay nested, timestamps are ISO 8601 strings.
dt=is the date the sync ran (UTC), not a date from the data.
Each record also carries these PortPilot fields:
| Field | Meaning |
|---|---|
_pipestream_extracted_at | When the sync read the record (ISO 8601). Use it to pick the latest version of a row. |
_pipestream_run_id | The sync run that wrote it. |
_pipestream_table | Source table or stream name. |
_pipestream_seq | Position of the record in the run's file. |
Sync behavior
Section titled “Sync behavior”- Incremental tables (upsert or append): each sync adds a new file. Files are never
rewritten, so a record updated in the source appears again in a later file. For the current
state, keep the row with the latest
_pipestream_extracted_atper primary key (listed in_schema.json). - Full-refresh tables (replace): the new file is written first, then the table’s older files are deleted, so the table is never empty.
- Re-running a sync overwrites that run’s own file, so retries never duplicate data.
Common gotchas
Section titled “Common gotchas”- Deduplicate when you read. Incremental tables hold every version of a changed record.
In BigQuery, over an external table:
QUALIFY ROW_NUMBER() OVER (PARTITION BY id ORDER BY _pipestream_extracted_at DESC) = 1. - JSON Lines only. Parquet and CSV aren’t available yet.
- Deletes aren’t represented. Records deleted at the source stay in earlier files.
- Hive partitioning in BigQuery. When creating an external table, enable Hive
partitioning with source URI prefix
gs://<bucket>/<prefix><table>/to get adtcolumn you can filter on.