Google BigQuery
This documentation describes the integration of MindsDB with Google BigQuery, a fully managed, AI-ready data analytics platform that helps you maximize value from your data. The integration allows MindsDB to access data stored in the BigQuery warehouse and enhance it with AI capabilities.
Prerequisites
Before proceeding, ensure the following prerequisites are met:
- Install MindsDB locally via Docker or Docker Desktop.
- To connect BigQuery to MindsDB, install the required dependencies following this instruction.
Connection
Establish a connection to your BigQuery warehouse from MindsDB by executing the following SQL command:
Required connection parameters include the following:
project_id
: The globally unique identifier for your project in Google Cloud where BigQuery is located.dataset
: The default dataset to connect to.
Optional connection parameters include the following:
service_account_keys
: The full path to the service account key file.service_account_json
: The content of a JSON file defined by theservice_account_keys
parameter.
One of service_account_keys
or service_account_json
has to be provided to
establish a connection to BigQuery.
Usage
Retrieve data from a specified table in the default dataset by providing the integration name and table name:
Retrieve data from a specified table in a different dataset by providing the integration name, dataset name and table name:
Run SQL in any supported BigQuery dialect directly on the connected BigQuery database:
The above examples utilize bigquery_datasource
as the datasource name, which
is defined in the CREATE DATABASE
command.
Troubleshooting Guide
Database Connection Error
- Symptoms: Failure to connect MindsDB with the BigQuery warehouse.
- Checklist:
- Make sure that the Google Cloud account is active and the Google BigQuery service is enabled.
- Confirm that the project ID, dataset and service account credentials are correct. Try a direct BigQuery connection using a client like DBeaver.
- Ensure a stable network between MindsDB and Google BigQuery.
SQL statement cannot be parsed by mindsdb_sql
- Symptoms: SQL queries failing or not recognizing table names containing spaces or special characters.
- Checklist:
- Ensure table names with spaces or special characters are enclosed in backticks. Examples: _ Incorrect: SELECT _ FROM integration.travel data _ Incorrect: SELECT _ FROM integration.‘travel data’ _ Correct: SELECT _ FROM integration.`travel data`
Was this page helpful?