# BigQuery

<figure><img src="/files/Uf5SapnDTc3f3qFeZsy3" alt=""><figcaption></figcaption></figure>

With Codatum, you can connect, query, and manage data of BigQuery.

## How to Set Up

### Steps in BigQuery

First, perform the following operations in the BigQuery console:

* Generate a service account and service account key
* Grant the following roles or permissions to the target project:
  * Role `BigQuery Job User` or the following permissions:
    * `bigquery.jobs.create`
  * Role `BigQuery Read Session User` or the following permissions:
    * `bigquery.readsessions.create`
    * `bigquery.readsessions.getData`
    * `bigquery.readsessions.update`
  * Save the target`Project ID` as it is necessary for the later [steps in Codatum](#steps-in-codatum)
* Grant the following roles or permissions to the target datasets:
  * Role `BigQuery Data Viewer` or the following permissions:
    * `bigquery.tables.getData`
    * `bigquery.datasets.get`
    * `bigquery.tables.get`
    * `bigquery.tables.list`
* (Optional) Grant the following permissions to the target project if you want to avoid entering the Project ID each time you sync the dataset table information
  * `resourcemanager.projects.get`

### Steps in Codatum

Finally, create Connection in Codatum

1. In the `Workspace Settings` -> `Connections`, select `Add Connection`
2. Enter a `Connection Name`
3. Select the `Access Level`
4. Upload the service account key using `File upload`
5. Enter the `Project ID`
   * Use the `Project ID` you saved in the steps above.
6. Add datasets to the `Sync target`

## Use INFORMATION\_SCHEMA for Searching

If you grant the `bigquery.admin` permission to the target project, you can utilize INFORMATION\_SCHEMA tables to search any tables in non-synced datasets.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.codatum.com/connect-and-manage-data/supported-warehouses/bigquery.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
