BigQuery Data Source Connections¶
This page describes how to connect to BigQuery data. Some configuration is required in BigQuery prior to setting up the connection in Okera.
Required BigQuery Configuration¶
Before you create a BigQuery connection in Okera, you must set up a BigQuery Service account and download the associated service account key.
- Create a BigQuery Service account. Looker's documentation has some easy-to-follow instructions on how to do this.
- Grant the desired BigQuery permissions for the Okera connection to this service account.
- Download the BigQuery service account private key certificate.
- Upload and set the location of your BigQuery service account key on your Okera cluster as
BIGQUERY_PRIVATE_KEY
in your cluster configuration file.
Create a BigQuery Connection¶
-
Create a new BigQuery connection from the Connections Page.
-
Provide values for these fields:
- Project Name: The Google project ID. Note please use the project ID here and not the project name.
- Service Account Name: The username for your BigQuery service account.
-
Test your connection to see if it works. If you receive an error please check that:
BIGQUERY_PRIVATE_KEY
has been correctly configured on your cluster- Your BigQuery service account has enough permissions to read data from your BigQuery project
- That you input the project ID and not the project name
Programmatic Connection Example¶
Here is a programmatic example of a BigQuery connection.
CREATE DATACONNECTION bigquery_connection_03 CXNPROPERTIES
(
'connection_type'='JDBC',
'jdbc_driver'='bigquery',
'connection_properties'='{
"url":"jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=<Project_ID>;OAuthType=0;OAuthServiceAcctEmail=<Service_account_name>;OAuthPvtKeyPath={BIGQUERY_PRIVATE_KEY}"
}'
);