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.comover 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
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.dataEditoron the target dataset (or finerdataset.tables.create,dataset.tables.updateData,dataset.tables.delete).roles/bigquery.jobUseron the project (to run load and merge jobs).If
staging_bucketis configured:roles/storage.objectAdmin(or finerobjects.create,objects.delete) on the staging bucket.
URI format
Inline credentials variant:
Sink options
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_tableaccepts either two-part (dataset.table) or three-part (project.dataset.table) names.Supported pipeline types:
batchandcdc.Authentication fallback: when neither
credentials_pathnorcredentials_base64is 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
locationquery parameter must all be in the same region or BigQuery will reject the load withLocation: <X>mismatch errors.
Troubleshooting
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.
Related docs
Google BigQuery: companion batch source connector.
Optimize sink datasets: guidance on
incremental_strategy,partition_by,cluster_by, and other dataset-shape settings.
Last updated
Was this helpful?