> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/data-sources-and-connectors/connectors/bigquery.md).

# BigQuery

Connect RootCause to Google BigQuery to import tables from your datasets, run SQL, or query BigQuery directly.

***

### Prerequisites

* A Google Cloud project with BigQuery enabled
* A service account with read access, typically the BigQuery Data Viewer and BigQuery Job User roles
* The service account's JSON key file

***

### Setting up the connection

1. In the Import Manager, click the **BigQuery** card
2. Enter your connection details:

| Field                    | Description                                                            | Example                                   |
| ------------------------ | ---------------------------------------------------------------------- | ----------------------------------------- |
| Project ID               | Google Cloud project                                                   | `my-project-123`                          |
| Service Account Email    | The service account identity                                           | `service@project.iam.gserviceaccount.com` |
| Default BigQuery dataset | Used when an import or direct query does not name a dataset of its own | `my_dataset`                              |
| Private Key              | The private\_key from the service account JSON                         |                                           |

3. Click **Test connection** to verify, then **Save & continue**

{% hint style="info" %}
Shortcut: paste the entire downloaded JSON key file into the Private Key field and the platform pulls out what it needs.
{% endhint %}

***

### Importing data

**Tables**: browse datasets and tables in the project. **Custom Query**: any BigQuery SQL, including queries across datasets; unqualified names use the default dataset.

<figure><img src="https://1662811113-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBXg3gZLR0e2Q8SzeQmql%2Fuploads%2Fgit-blob-c905a035ea9cbf9b176e47eade3c19785564b133%2Frc-bigquery-import-settings.png?alt=media" alt="BigQuery import settings browsing a dataset"><figcaption><p>Browsing a BigQuery dataset and selecting a table to import.</p></figcaption></figure>

***

### Import modes

Full Import, Full Import + Live, Recent Rows, Time Period and Query Directly. Rolling windows are resolved by BigQuery, which also keeps scanned bytes down. See [Connectors](/data-sources-and-connectors/connectors.md).

***

### Troubleshooting

**Permission denied**

* The service account needs dataset-level read access and jobs.create on the project

**Not found: Dataset**

* Check the default dataset name and its location (region) against the query

**Invalid private key**

* Paste the whole JSON key file rather than a fragment of the key
