For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

BigQuery

BigQuery destination. Writes Nilus batch, CDC, and stream output into BigQuery datasets using a service-account credential; supports GCS staging and parquet loading.

Google BigQuery is a managed analytical warehouse on Google Cloud. Nilus writes into BigQuery datasets and tables for both batch and CDC pipelines using a service-account-authenticated connection, with optional GCS staging for large loads.

Requirements

Connectivity and credentials must both be in place before the pipeline can run.

Connectivity

  • The Nilus runtime must reach https://bigquery.googleapis.com over HTTPS.

  • For staged loads, the runtime must also reach https://storage.googleapis.com.

  • The destination project (encoded as the URI hostname) and the BigQuery dataset must already exist; Nilus does not auto-create datasets.

Required parameters

Parameter
Required
Default
Description

project

Yes

-

GCP project ID that owns the destination dataset. Encoded as the URI hostname.

credentials_path

Conditional

-

Path to a Google service-account JSON key file. Mutually exclusive with credentials_base64.

credentials_base64

Conditional

-

Base64-encoded contents of the service-account JSON key. Mutually exclusive with credentials_path. When neither is supplied, Nilus falls back to Application Default Credentials.

location

No

runtime default (US)

BigQuery location for the destination dataset, for example US, EU, asia-southeast1. Must match the dataset's actual location.

Permissions

The service account behind the credentials needs at minimum:

  • roles/bigquery.dataEditor on the target dataset (or finer dataset.tables.create, dataset.tables.updateData, dataset.tables.delete).

  • roles/bigquery.jobUser on the project (to run load and merge jobs).

  • If staging_bucket is configured: roles/storage.objectAdmin (or finer objects.create, objects.delete) on the staging bucket.

URI format

Inline credentials variant:

Sink options

Option
Required
Description

dest_table

Yes

Target table in <dataset>.<table> form, or <project>.<dataset>.<table> for cross-project writes.

incremental_strategy

Yes

One of replace, append, or merge.

staging_bucket

No

gs://-prefixed staging bucket for large loads. Validated to start with gs://; raises otherwise.

Sample Nilus configs

Each example below is self-contained and uses the current Nilus pipeline shape.

Batch ingestion

CDC ingestion with GCS staging

Behavior and capabilities

  • Compute model: Nilus connects with a service account and submits BigQuery jobs; BigQuery executes the load / merge.

  • Object model: BigQuery datasets and tables. dest_table accepts either two-part (dataset.table) or three-part (project.dataset.table) names.

  • Supported pipeline types: batch and cdc.

  • Authentication fallback: when neither credentials_path nor credentials_base64 is supplied, the runtime falls back to Application Default Credentials. Useful when running the pipeline on a GCE / GKE instance that already has a workload identity attached.

  • Region awareness: the dataset, the staging bucket (if any), and the location query parameter must all be in the same region or BigQuery will reject the load with Location: <X> mismatch errors.

Troubleshooting

Symptom
Likely cause
Resolution

Table name must be in the format <dataset>.<table> or <project>.<dataset>.<table>

dest_table was supplied as a bare table name.

Use the qualified <dataset>.<table> form (or three-part for cross-project writes).

Staging bucket must start with gs://

The staging_bucket value uses gcs:// or omits the scheme.

Use the canonical gs://<bucket> form.

403 Permission … denied on resource …

Service account lacks dataset or job-running permissions.

Grant roles/bigquery.dataEditor on the dataset and roles/bigquery.jobUser on the project.

Cannot read and write in different locations

Dataset, staging bucket, and location query param are not all in the same BigQuery region.

Align the dataset region, the staging bucket region, and the location value.

Application Default Credentials unexpectedly used

Both credential parameters were omitted; the runtime fell back to ADC.

Pass credentials_path or credentials_base64 explicitly when ADC is not the intended auth method.

Last updated

Was this helpful?