# BigQuery

<figure><img src="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-500015d24c31a12c1f916e9f797f9ccec277704a%2F%20%20bq.png?alt=media" 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.
