Installation
Install the BigQuery connector:Authentication Methods
BigQuery supports three authentication methods:- Service Account (recommended for production)
- GCloud CLI (recommended for local development)
- OAuth Access Token
Configuration
Service Account Authentication
Create a service account in Google Cloud and download the JSON key file.GCloud CLI Authentication
Use your local gcloud credentials (requiresgcloud auth login).
connection.yaml
OAuth Access Token
Use a pre-obtained OAuth access token.connection.yaml
Configuration Parameters
Google Cloud project ID
BigQuery dataset location/region (e.g., US, EU, us-west1)
Authentication method:
service-account, gcloud-cli, or oauthService Account Parameters
Service account email address from the credentials JSON file
Private key from the credentials JSON file. Newlines should be preserved as
\nEnable access to Google Sheets. Adds additional OAuth scopes for Drive API access
OAuth Parameters
OAuth 2.0 access token
Using Credentials File
You can reference a credentials JSON file directly:connection.yaml
Features
Type Mapping
BigQuery types are mapped to Evidence types:- Numbers: INT64, NUMERIC, BIGNUMERIC, FLOAT64, DECIMAL
- Strings: STRING, BYTES, GEOGRAPHY, TIME
- Dates: TIMESTAMP, DATE, DATETIME
- Booleans: BOOL, BOOLEAN
Special Types
- GEOGRAPHY: Returned as string values
- TIME: Returned as string values
- BYTES: Returned as base64-encoded strings
- Large integers: Automatically converted to numbers
Streaming Results
The connector streams query results in batches (default 100,000 rows) for memory-efficient processing of large datasets.Example Query
Create a SQL file in your Evidence project:queries/sales_by_region.sql
Troubleshooting
Private key formatting issues
Private key formatting issues
Ensure newlines in the private key are escaped as
\n. When using environment variables, the entire key should be on one line with escaped newlines:Project not found errors
Project not found errors
Verify that:
- The project ID is correct
- The service account has the necessary permissions (BigQuery User, BigQuery Data Viewer)
- Billing is enabled for the project
Connected Sheets access
Connected Sheets access
To query Google Sheets data, set
enable_connected_sheets: true. This adds Drive API scopes to the service account.