Skip to main content
GuideServerConfigure and deploy Tabsdata servers on your machine.TutorialsConfigure data integration workflows within a running Tabsdata server.API ReferenceCLI ReferenceRelease Notes
Version: 2.1.0

BigQuery

The BigQuery connector lets Tabsdata write tables into BigQuery. BigQuery is destination-only: there is no publisher-side connector for reading from BigQuery.

The BigQueryDest connector can be used by a subscriber function to write data from a Tabsdata table into BigQuery. See the full subscriber walkthrough

Connection​

BigQuery subscribers use BigQueryDestConn to define the GCS staging location and credentials used by the subscriber. The connector stages each write as parquet in GCS, then runs a load job against BigQuery referencing that object.

conn-bigquery.yaml
kind: connectionDef
apiVersion: '1.0'
type: tabsdatak.conn.bigquery:BigQueryDestConn
spec:
staging:
bucket: 'acme-stage'
credentials:
kind: gcpJsonCredentials
apiVersion: '1.0'
type: tabsdatak.conn.common.types:GCPJson
spec:
json: 'secret:{"type": "service_account", ...}'
base_path: '/bigquery'
credentials:
kind: gcpJsonCredentials
apiVersion: '1.0'
type: tabsdatak.conn.common.types:GCPJson
spec:
json: 'secret:{"type": "service_account", ...}'
  • required
  • required
  • optional
  • optional
  • optional
  • optional

Connection Config Parameters​

staging​

The GCSLocation used as the parquet staging bucket for load jobs: a bucket, credentials (GCP service-account JSON), and base_path (defaults to /, same rules as other connectors' base_path: starts with /, cannot end with /, cannot contain empty path segments).

credentials​

The GCP service-account JSON credentials (GCPJson) used to run the BigQuery load job, separate from the credentials on staging used to upload to GCS.

project​

The default GCP project id. Required when dataset is set.

dataset​

The default BigQuery dataset id. Requires project to be set.

entity_whitelist​

An optional list of regex patterns narrowing which tables the connector considers. Unset by default, which filters nothing.

conn_cfg​

Optional connector configuration overrides.

Subscriber​

For merge writes, schema evolution, and retry watermarks, see Merging into SQL destinations.

Configure BigQueryDest as the destination of a subscriber function to define which tables Tabsdata writes in BigQuery.

write_orders.py
from tabsdatak.api import subscriber
from tabsdatak.conn.bigquery import BigQueryDest

@subscriber(
destination=BigQueryDest(
tables=[
"orders",
],
),
input_tables=["orders"],
)
def write_orders(orders):
return orders
  • required
  • optional
  • optional
  • optional

Function Config Parameters​

tables​

Defines the destination tables the subscriber writes to in BigQuery.

Each element in tables represents one destination slot and maps positionally to a value returned by the subscriber function. Each name is [[project.]dataset.]table; a bare table or dataset.table is completed from the connection's project/dataset defaults. BigQuery wraps the whole name in one backtick pair, e.g. `my-project.ds.t`.

if_table_exists​

"merge" applies inserts, updates, and deletes by key and requires a merge_cfg list. See Merge configuration for a complete example.

Controls what happens when the destination table already exists. "append" (the default) adds rows. "replace" drops and recreates the table.

schema_evolution​

Controls how new columns in the returned frame are handled. "update" allows new columns. "strict" is the default and leaves existing data columns unchanged. See Merging into SQL destinations for merge-specific behavior.

dest_cfg​

Sets additional destination configuration. Supported keys include bigquery.logging_level and bigquery.schema_evolution_engine. Merge mode requires bigquery.schema_evolution_engine="iceberg".