Connect BigQuery
Connect Zingg to Google BigQuery as a data source and output destination. Requires two dependency JARs and Google Cloud credentials.
Prerequisites
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.jarSet the Spark Hadoop property.
spark.hadoop.fs.gs.impl = com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystemIf running outside Google Cloud, set credentials.
export GOOGLE_APPLICATION_CREDENTIALS = / path / to / service - account - key.jsonFor 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
Last updated
Was this helpful?