For the complete documentation index, see llms.txt. This page is also available as Markdown.

Connect BigQuery

Connect Zingg to Google BigQuery as a data source and output destination. Requires two dependency JARs and Google Cloud credentials.

Prerequisites

  1. BigQuery requires two dependency JARs. Download and add to zingg.conf.

spark.jars = ./ spark - bigquery - with - dependencies_2 .12 - 0.24.2.jar, \
./ gcs - connector - hadoop2 - latest.jar
  1. Set the Spark Hadoop property.

spark.hadoop.fs.gs.impl = com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem
  1. If running outside Google Cloud, set credentials.

export GOOGLE_APPLICATION_CREDENTIALS = / path / to / service - account - key.json

For the full Zingg installation, cluster setup, and any additional dependency configuration required when connecting Spark to BigQuery, follow the GCP Dataproc Platform Guide.

Python API

from zingg.client import*
from zingg.pipes import*

bqInput = BigQueryPipe("bqInput")
bqInput.addProperty("credentialsFile", "/path/to/key.json")
bqInput.addProperty("table", "project-id.dataset.tablename")
bqInput.addProperty("viewsEnabled", "true")
args.setData(bqInput)

bqOutput = BigQueryPipe("bqOutput")
bqOutput.addProperty("credentialsFile", "/path/to/key.json")
bqOutput.addProperty("table", "project-id.dataset.outputtable")
bqOutput.addProperty("temporaryGcsBucket", "your-gcs-bucket")
args.setOutput(bqOutput)

JSON Config

right-long

Last updated

Was this helpful?