Google BigQuery
Connect to Google BigQuery for cloud data warehouse analytics
Google BigQuery is a serverless, highly scalable enterprise data warehouse from Google Cloud. Scoop connects directly to BigQuery, enabling AI-powered analysis on your cloud data.
Connection Details
| Setting | Value |
|---|---|
| Default Port | 443 |
| Connection Type | HTTPS |
| Authentication | Service Account |
Prerequisites
Before connecting Scoop to BigQuery:
- Google Cloud project with BigQuery enabled
- Service account with BigQuery Data Viewer role
- Service account key (JSON format)
Create a Service Account
- Go to Google Cloud Console > IAM and Admin > Service Accounts
- Click Create Service Account
- Enter a name (e.g.,
scoop-bigquery-reader) - Click Create and Continue
- Grant the role BigQuery Data Viewer
- Click Done
Generate a Key
- Click on your new service account
- Go to the Keys tab
- Click Add Key > Create new key
- Select JSON format
- Download and securely store the key file
Grant Dataset Access
If you need access to specific datasets only:
- Go to BigQuery in Google Cloud Console
- Select your dataset
- Click Share > Permissions
- Add your service account email
- Assign the BigQuery Data Viewer role
Connect in Scoop
- Navigate to Datasets and click New Dataset
- Select Database as your source
- Choose BigQuery from the database type dropdown
- Enter your connection details:
- Server Host: Your project ID (e.g.,
my-project-123456) - Database: Your dataset name
- Username: Not required (use service account)
- Password: Paste the contents of your service account JSON key
- Server Host: Your project ID (e.g.,
- Click Test Connection to verify
- Enter your SQL query and proceed
Connection URL Format
If using a JDBC URL directly:
jdbc:BQDriver:project_id;Dataset=dataset_name
Query Syntax Notes
BigQuery uses a slightly different SQL syntax:
-- Use backticks for table references with special characters
SELECT * FROM `project.dataset.table_name`
-- Use TIMESTAMP instead of datetime functions
SELECT TIMESTAMP('2024-01-01')
-- Use STRUCT for complex types
SELECT STRUCT(field1, field2) as my_structBest Practices
- Use partitioned tables to reduce query costs and improve performance
- Use clustered tables for frequently filtered columns
- Set maximum bytes billed to prevent unexpected costs
- Use table wildcards cautiously as they can scan many tables
Cost Considerations
BigQuery charges based on the amount of data scanned by your queries:
- Use
SELECT *sparingly; select only needed columns - Filter on partitioned columns when possible
- Use
LIMITduring development and testing - Monitor query costs in the BigQuery console
Troubleshooting
Authentication Failed
- Verify the service account JSON key is complete and valid
- Check that the service account has BigQuery Data Viewer role
- Ensure the project ID is correct
Dataset Not Found
- Verify the dataset name is spelled correctly
- Check that the service account has access to the dataset
- Ensure you're using the correct project ID
Permission Denied
- Verify the service account has the BigQuery Data Viewer role
- Check dataset-level permissions if using fine-grained access
- Ensure the service account is in the same organization (for org-restricted datasets)
Updated about 5 hours ago