> For the complete documentation index, see [llms.txt](https://docs.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.collibra.com/data-quality-self-hosted/connections/supported-connections/supported-jdbc-data-sources/connecting-to-google-bigquery.md).

# Connecting to Google BigQuery

This section contains details for Google BigQuery connections.

Select an option from the drop-down menu to display information for a particular driver class.

{% tabs %}
{% tab title="Native" %}

## General information

<table><thead><tr><th width="152">Field</th><th>Description</th></tr></thead><tbody><tr><td>Data source</td><td>Google BigQuery</td></tr><tr><td>Supported versions</td><td>1.6.5.1002</td></tr><tr><td>Connection string</td><td><code>jdbc:bigquery://</code></td></tr><tr><td>Packaged?</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-de45f34193ae06a2b093c2dfb8fb80cfda945166%2Fclose-large%402x.png?alt=media" alt="" data-size="line"> No</td></tr><tr><td>Certified?</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td colspan="2">Supported features</td></tr><tr><td>Estimate job</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td>Analyze data</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td>Schedule</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td colspan="2">Processing capabilities</td></tr><tr><td>Pushdown</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td>Spark agent</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td>Yarn agent</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td>Parallel JDBC</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td colspan="2">Java Platform version compatibility</td></tr><tr><td>JDK 8</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td>JDK 11</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr></tbody></table>

## Minimum user permissions

To bring your BigQuery data into Data Quality & Observability (self-hosted), you need the following permissions:

* Read access on your BigQuery dataset tables.
* BigQuery job editor access.
* Write access on the materialized view datasets.
* `ROLE_ADMIN` assigned to your user in Collibra DQ.
* Structural metadata ingestion permissions:

  * `bigquery.datasets.get`
  * `bigquery.jobs.create`
  * `bigquery.tables.get`
  * `bigquery.tables.getData`
  * `bigquery.tables.list`
  * `resourcemanager.projects.get`

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The names of these permissions are subject to change. See the <a href="https://cloud.google.com/bigquery/docs/access-control">official BigQuery documentation</a>.</p></div>
* Data Quality pushdown permissions:

  * `roles/bigquery.dataViewer`
  * `roles/bigquery.jobUser`
  * `roles/bigquery.readSessionUser`
  * `roles/bigquery.dataOwner` permissions on the temporary dataset

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The names of these permissions are subject to change. See the <a href="https://cloud.google.com/bigquery/docs/access-control">official BigQuery documentation</a>.</p></div>

### Networking and firewalls

Account for the following URLs from networking and firewall perspectives:

* logging.googleapis.com
* oauth2.googleapis.com
* googleapis.com
* bigquerystorage.googleapis.com
* bigquery.googleapis.com

## Recommended and required connection properties

| Required                                                                                                                                                                                                                                          | Connection Property | Type    | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes   | Name                | Text    | The unique name of your connection. Ensure that there are no spaces in your connection name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes   | Connection URL      | String  | <p>The connection string path of your BigQuery connection.</p><p>When referring to the example below, replace the <code>${value}</code> sections of the connection URL with your actual value.</p><p><i class="fa-glasses-round">:glasses-round:</i> Example: <code>jdbc:bigquery://<https://www.googleapis.com/bigquery/v2:443;OAuthType=0;ProjectId=${projectId};OAuthServiceAcctEmail=${service-account};OAuthPvtKeyPath=${/path/to/key};TimeOut=3600></code></p><hr>                                                                                                                                                                                                                                                                                                                                                                      |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes   | Driver Name         | String  | <p>The driver class name of your BigQuery connection.</p><p><code>com.simba.googlebigquery.jdbc42.Driver</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes   | Port                | Integer | <p>The port number to establish a connection to the datasource.</p><p>The default port is <code>443</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-de45f34193ae06a2b093c2dfb8fb80cfda945166%2Fclose-large%402x.png?alt=media" alt="" data-size="line"> No | Limit Schemas       | Option  | <p>Allows you to manage usage and restrict visibility to only the necessary schemas in the <a href="/data-quality-self-hosted/core-concepts/explorer/create-a-dq-job/connect-to-a-data-source.md">Explorer</a> tree.</p><p>See <a href="/data-quality-self-hosted/admin-configuration/admin-console/connections/limiting-schemas.md">Limiting schemas</a> to learn how to limit schemas from the Connection Management page.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>When you include a restricted schema in the query of a DQ Job, the query scope may be overwritten when the job runs. While only the schemas you selected when you set up the connection are shown in the Explorer menu, users are not restricted from running SQL queries on any schema from the data source.</p></div> |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-de45f34193ae06a2b093c2dfb8fb80cfda945166%2Fclose-large%402x.png?alt=media" alt="" data-size="line"> No | Source Name         | String  | N/A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-de45f34193ae06a2b093c2dfb8fb80cfda945166%2Fclose-large%402x.png?alt=media" alt="" data-size="line"> No | Target Agent        | Option  | The [Agent](/data-quality-self-hosted/installation/agent.md) that submits your Spark job for processing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes   | Auth Type           | Option  | <p>The method to authenticate your connection.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The configuration requirements differ depending on the Auth Type you select. See <a href="#authentication">Authentication</a> for more details on available authentication types.</p></div>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-de45f34193ae06a2b093c2dfb8fb80cfda945166%2Fclose-large%402x.png?alt=media" alt="" data-size="line"> No | Properties          | String  | The configurable driver properties for your connection. Multiple properties must be semicolon-delimited, and each property=value pair, including the last one, must end with a semicolon (;). `abc=123;test=true;`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| {% endtab %}                                                                                                                                                                                                                                      |                     |         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

{% tab title="CDATA" %}

## General information

<table><thead><tr><th width="152">Field</th><th>Description</th></tr></thead><tbody><tr><td>Data source</td><td>Google BigQuery</td></tr><tr><td>Supported versions</td><td>21.0.8160.0</td></tr><tr><td>Connection string</td><td><code>jdbc:googlebigquery:</code></td></tr><tr><td>Packaged?</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td>Certified?</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td colspan="2">Supported features</td></tr><tr><td>Estimate job</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td>Analyze data</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td>Schedule</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-de45f34193ae06a2b093c2dfb8fb80cfda945166%2Fclose-large%402x.png?alt=media" alt="" data-size="line"> No</td></tr><tr><td colspan="2">Processing capabilities</td></tr><tr><td>Pushdown</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td>Spark agent</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td>Yarn agent</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-de45f34193ae06a2b093c2dfb8fb80cfda945166%2Fclose-large%402x.png?alt=media" alt="" data-size="line"> No</td></tr><tr><td>Parallel JDBC</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td colspan="2">Java Platform version compatibility</td></tr><tr><td>JDK 8</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr><tr><td>JDK 11</td><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td></tr></tbody></table>

## Minimum user permissions

To bring your BigQuery data into Data Quality & Observability (self-hosted), you need the following permissions:

* Read access on your BigQuery dataset tables.
* BigQuery job editor access.
* Write access on the materialized view datasets.
* `ROLE_ADMIN` assigned to your user in Collibra DQ.
* Structural metadata ingestion permissions:

  * `bigquery.datasets.get`
  * `bigquery.jobs.create`
  * `bigquery.tables.get`
  * `bigquery.tables.getData`
  * `bigquery.tables.list`
  * `resourcemanager.projects.get`

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The names of these permissions are subject to change. See the <a href="https://cloud.google.com/bigquery/docs/access-control">official BigQuery documentation</a>.</p></div>
* Data Quality pushdown permissions:

  * `roles/bigquery.dataViewer`
  * `roles/bigquery.jobUser`
  * `roles/bigquery.readSessionUser`
  * `roles/bigquery.dataOwner` permissions on the temporary dataset

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The names of these permissions are subject to change. See the <a href="https://cloud.google.com/bigquery/docs/access-control">official BigQuery documentation</a>.</p></div>

### Networking and firewalls

Account for the following URLs from networking and firewall perspectives:

* logging.googleapis.com
* oauth2.googleapis.com
* googleapis.com
* bigquerystorage.googleapis.com
* bigquery.googleapis.com

## Recommended and required connection properties

| Required                                                                                                                                                                                                                                          | Connection Property | Type    | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes   | Name                | Text    | The unique name of your connection. Ensure that there are no spaces in your connection name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes   | Connection URL      | String  | <p>The connection string path of your BigQuery connection.</p><p>When referring to the example below, replace the <code>${value}</code> sections of the connection URL with your actual value.</p><p><i class="fa-glasses-round">:glasses-round:</i> Example: <code>jdbc:googlebigquery:AuthScheme="OAuthJWT";OAuthSettingsLocation=memory://;ProjectId=${projectId};InitiateOAuth="GETANDREFRESH";OAuthJWTCert="/tmp/keytab/bigquery.json";OAuthJWTCertType="GOOGLEJSON";OAuthJWTIssuer="iam.service.account";BrowsableSchemas=\<param1,param2>;</code></p><hr><p>The <code>BrowsableSchemas</code> parameter enables you to limit which datasets/schemas are loaded for a project. Replace <code>\<param1, param2></code> with the actual values (comma-delimited).</p>                                                                     |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes   | Driver Name         | String  | <p>The driver class name of your BigQuery connection.</p><p><code>cdata.jdbc.googlebigquery.GoogleBigQueryDriver</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes   | Port                | Integer | <p>The port number to establish a connection to the datasource.</p><p>The default port is <code>443</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-de45f34193ae06a2b093c2dfb8fb80cfda945166%2Fclose-large%402x.png?alt=media" alt="" data-size="line"> No | Limit Schemas       | Option  | <p>Allows you to manage usage and restrict visibility to only the necessary schemas in the <a href="/data-quality-self-hosted/core-concepts/explorer/create-a-dq-job/connect-to-a-data-source.md">Explorer</a> tree.</p><p>See <a href="/data-quality-self-hosted/admin-configuration/admin-console/connections/limiting-schemas.md">Limiting schemas</a> to learn how to limit schemas from the Connection Management page.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>When you include a restricted schema in the query of a DQ Job, the query scope may be overwritten when the job runs. While only the schemas you selected when you set up the connection are shown in the Explorer menu, users are not restricted from running SQL queries on any schema from the data source.</p></div> |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-de45f34193ae06a2b093c2dfb8fb80cfda945166%2Fclose-large%402x.png?alt=media" alt="" data-size="line"> No | Source Name         | String  | N/A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-de45f34193ae06a2b093c2dfb8fb80cfda945166%2Fclose-large%402x.png?alt=media" alt="" data-size="line"> No | Target Agent        | Option  | The [Agent](/data-quality-self-hosted/installation/agent.md) that submits your Spark job for processing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes   | Auth Type           | Option  | <p>The method to authenticate your connection.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The configuration requirements differ depending on the Auth Type you select. See <a href="#authentication">Authentication</a> for more details on available authentication types.</p></div>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-de45f34193ae06a2b093c2dfb8fb80cfda945166%2Fclose-large%402x.png?alt=media" alt="" data-size="line"> No | Properties          | String  | The configurable driver properties for your connection. Multiple properties must be semicolon-delimited, and each property=value pair, including the last one, must end with a semicolon (;). `abc=123;test=true;`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| {% endtab %}                                                                                                                                                                                                                                      |                     |         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| {% endtabs %}                                                                                                                                                                                                                                     |                     |         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

## Authentication

Select an authentication type from the dropdown menu. The options available in the dropdown menu are the currently supported authentication types for this data source.

{% tabs %}
{% tab title="Username/Password" %}

| Required                                                                                                                                                                                                                                        | Field    | Description                                                                                                                                                                                                                                                                                                                                    |                                                                                                                                                                                                                                             |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes | Username | <p>The username of your BigQuery service account.</p><p>Set Username to any value.</p>                                                                                                                                                                                                                                                         |                                                                                                                                                                                                                                             |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes | Password | <p>The password of your BigQuery service account.</p><p>Enter the base64 encoded string of your OAuth key.</p><p><strong>base64 encoded commands</strong></p><p>To encode your credential JSON file as a base64 encoded string, use one of the following commands:</p><p><code>base64 your\_json.json -w 0</code> or <code>cat your\_json.json | base64 -w 0</code></p><div data-gb-custom-block data-tag="hint" data-style="success" class="hint hint-success"><p>Your JSON file is typically available to download in GCP when you create a service account in your IAM profile.</p></div> |
| {% endtab %}                                                                                                                                                                                                                                    |          |                                                                                                                                                                                                                                                                                                                                                |                                                                                                                                                                                                                                             |

{% tab title="Password Manager" %}

| Required                                                                                                                                                                                                                                          | Field    | Description                                                                                                                                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes   | Username | <p>The username of your BigQuery service account.</p><p>Set Username to any value.</p>                                                                                                                                                   |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes   | Script   | <p>The file path that contains the script file that the password manager uses to interact with and authenticate a user account.</p><p><i class="fa-glasses-round">:glasses-round:</i> Example: /tmp/keytab/bigquery\_pwd\_mgr.sh</p><hr> |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-de45f34193ae06a2b093c2dfb8fb80cfda945166%2Fclose-large%402x.png?alt=media" alt="" data-size="line"> No | Param $1 | Optional. An additional parameters to authenticate your BigQuery connection.                                                                                                                                                             |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-de45f34193ae06a2b093c2dfb8fb80cfda945166%2Fclose-large%402x.png?alt=media" alt="" data-size="line"> No | Param $2 | Optional. An additional parameter to authenticate your BigQuery connection.                                                                                                                                                              |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-de45f34193ae06a2b093c2dfb8fb80cfda945166%2Fclose-large%402x.png?alt=media" alt="" data-size="line"> No | Param $3 | Optional. An additional parameter to authenticate your BigQuery connection.                                                                                                                                                              |
| {% endtab %}                                                                                                                                                                                                                                      |          |                                                                                                                                                                                                                                          |

{% tab title="Service Account Credential" %}

<table><thead><tr><th>Required</th><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes</td><td>JSON Credential File</td><td><p>The JSON file containing service account access credentials from your local file storage. Click anywhere in the Service Account Credential field, then upload the JSON credential file containing your Google IAM service account key.</p><p><strong>Plain text JSON example</strong></p><p>The JSON file contains the following service account information:</p><pre><code>{
  "type": "service_account",
  "project_id": "owl-hadoop-cdh",
  "private_key_id": "&#x3C;your-private-key-id-string>",
  "private_key": "-----BEGIN PRIVATE KEY-----\&#x3C;encoded-string>\n-----END PRIVATE KEY-----\n",
  "client_email": "&#x3C;your-service-account>@developer.gserviceaccount.com",
  "client_id": "your-service-account-id-string",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/&#x3C;your-service-account>@developer.gserviceaccount.com"
}
</code></pre><div data-gb-custom-block data-tag="hint" data-style="success" class="hint hint-success"><p>Your JSON file is typically available to download in GCP when you create a service account in your IAM profile.</p></div><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The cdata.jdbc.googlebigquery.GoogleBigQueryDriver driver does not support JSON Credential File authentication.</p></div></td></tr></tbody></table>
{% endtab %}

{% tab title="Workload Identity" %}

| Required                                                                                                                                                                                                                                        | Field             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="https://4121921244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWCrP7Albs8DfJjIQxUxw%2Fuploads%2Fgit-blob-d06dd40622fc7d030e21f7c0303a90eb28d229fc%2Fok-large%402x.png?alt=media" alt="" data-size="line"> Yes | Workload Identity | <p>Refer to <a href="/data-quality-self-hosted/connections/supported-connections/supported-jdbc-data-sources/connecting-to-google-bigquery/configuring-workload-identity-for-google-bigquery.md">Configuring Workload Identity for Google BigQuery</a> for information on how to set it up.</p><p>Because the Connection URL contains the Project ID associated with the GCP cluster that was set up with the access grant, you only need to select Workload Identity from the Authentication Type dropdown menu, specify an agent, and fill out the other required fields in the connection template once you configure Workload Identity.</p> |
| {% endtab %}                                                                                                                                                                                                                                    |                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| {% endtabs %}                                                                                                                                                                                                                                   |                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

## Views

When creating views from different datasets (collections), you can add the `viewsEnabled=true` parameter to the connection property when defining the connection.

For read/write access to BigQuery, you can use the Spark BigQuery connector. To use this connector, ensure that you have the following configurations:

* Set `viewsEnabled=true`.
* Set `materializationDataset` to a dataset where the GCP user has table creation permission.
* Optionally set `materializationProject`.

The connector is implemented by running the query on BigQuery and the results are saved into a temporary table. Spark will then read the results, which could result in additional costs on your BigQuery account.

{% hint style="info" %}
`WITH` clauses with common table expressions (CTEs) improve query readability but do not guarantee better performance. Adding a `WITH` clause does not ensure that BigQuery will create temporary intermediate tables or reuse the results for multiple references. The `WITH` clause may be evaluated multiple times within a query, depending on the query optimizer's decisions.
{% endhint %}

## Cross-project connections

Use this configuration when the project that owns the data differs from the project where jobs are billed and executed. A common scenario is when a service account lives in a processing or governance project but needs to read data from a separate data project.

In the Simba BigQuery JDBC driver, `ProjectId` controls where jobs are created and billed, not which project's data is queried. Because of this, the service account must have `bigquery.jobs.create` permission in the project set as `ProjectId`. To access data from a different project, use `AdditionalProjects` and `QueryProperties`.

{% hint style="info" %}
The CDATA driver does not support this cross-project configuration. Use the Simba (native) driver for cross-project connections.
{% endhint %}

### URL parameters for cross-project connections

<table><thead><tr><th width="152">Parameter</th><th>Role</th></tr></thead><tbody><tr><td><code>ProjectId</code></td><td>The billing/processing project where jobs are created. The service account must have <code>bigquery.jobs.create</code> here.</td></tr><tr><td><code>AdditionalProjects</code></td><td>The data project(s) whose datasets should be accessible.</td></tr><tr><td><code>QueryProperties=dataset_project_id</code></td><td>Sets the default dataset context so DQ resolves schemas against the correct project.</td></tr><tr><td><code>BillingProjectId</code></td><td>Not required when ProjectId is already set to the billing project.</td></tr></tbody></table>

{% tabs %}
{% tab title="Example" icon="glasses-round" %}
Replace the ${value} sections with your actual values.

```
jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=${billing-project};OAuthType=0;OAuthServiceAcctEmail=${service-account};OAuthPvtKeyPath=${/path/to/key};AdditionalProjects=${data-project};QueryProperties=dataset_project_id=${data-project}
```

{% endtab %}
{% endtabs %}

## Miscellaneous

<table><thead><tr><th width="152">Connection property</th><th>Description</th></tr></thead><tbody><tr><td><code>AllowLargeResults</code></td><td>When set to <code>true</code>, this option allows results larger than the maximum response size when reading large tables.</td></tr><tr><td><code>QueryPassthrough</code></td><td>When set to <code>true</code>, this option passes the query to the Google BigQuery server as is, which can help overcome some SQL syntax errors for valid SQL queries.</td></tr></tbody></table>

### Command line example for basic spark-submit job

```
-lib "/opt/owl/drivers/bigquery/bigquery/core/" \
-h <IP_ADDRESS>:5432/postgres \
-master spark://<SPARK_MASTER>:7077 \
-ds samples.loan_customer \
-deploymode client \
-q "select * from samples.loan_customer" \
-rd "2021-08-02" \
-driver "com.simba.googlebigquery.jdbc42.Driver" \
-cxn BigQuery
```

### Using the profilepushdown option

When using a BigQuery JDBC connection with the `profilepushdown` option in a Kubernetes environment, an OAuth private key file is required for authentication. The Agent creates the key file in one of the following temporary directories:

* If the environment variable `OWL_SCRATCH_DIR` is set, the Agent places the key file in the directory specified by `OWL_SCRATCH_DIR`.
* If `OWL_SCRATCH_DIR` is not set, the Agent places the key file in the default Java temporary directory (typically `/tmp` or as defined by the JVM property `java.io.tmpdir`).

#### Steps

1. Add the following command line to set the `/tmp/scratch` location for Driver and Executor pods:

   ```
   spark.kubernetes.driverEnv.OWL_SCRATCH_DIR=/tmp/scratch,spark.kubernetes.executorEnv.OWL_SCRATCH_DIR=/tmp/scratch
   ```
2. Specify the OAuth private key file path for the `Connections` creation using the following parameter:

   ```
   OAuthPvtKeyPath={OWL_SCRATCH_DIR}/bigquery_{CONNECTION_NAME}.json
   ```

   For example, if your connection name is `sample_bigquery_pushdown` and `OWL_SCRATCH_DIR` is set to `/tmp/scratch`, the property is `OAuthPvtKeyPath=/tmp/scratch/bigquery_sample_bigquery_pushdown.json`. It is included the connection URL in the following example:

   `jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=owl-hadoop-cdh;OAuthType=0;OAuthServiceAcctEmail=1096839723485-compute@developer.gserviceaccount.com;OAuthPvtKeyPath=/tmp/scratch/bigquery_sample_bigquery_pushdown.json;Timeout=86400`

## Troubleshooting a connection

{% stepper %}
{% step %}
Password for the BigQuery Connector form in Collibra DQ must be a base64 encoded string created from the JSON file and input as password. For example: `base64 your_json.json -w 0` or `cat your_json.json | base64 -w 0`
{% endstep %}

{% step %}
Check that this JAR exists and is on the path of the Collibra DQ Web UI server. For example, \<INSTALL\_PATH>/owl/drivers/bigquery/core). Look at your driver directory location which contains this BigQuery JAR: spark-bigquery\_2.12-0.35.1.jar
{% endstep %}

{% step %}
Ensure these JARs present in \<INSTALL\_PATH>/owl/drivers/bigquery/:\*\*\*\*animal-sniffer-annotations-1.23.jar,annotations-4.1.1.4.jar,api-common-2.20.0.jar,auto-value-1.10.4.jar,auto-value-annotations-1.10.4.jar,avro-1.11.3.jar,cdata.jdbc.googlebigquery.jar,commons-codec-1.16.0.jar,commons-compress-1.26.0.jar,commons-logging-1.2.jar,conscrypt-openjdk-uber-2.5.2.jar,core,error\_prone\_annotations-2.22.0.jar,failureaccess-1.0.1.jar,gax-2.37.0.jar,gax-grpc-2.37.0.jar,google-api-client-2.2.0.jar,google-api-services-bigquery-v2-rev20231008-2.0.0.jar,google-auth-library-credentials-1.20.0.jar,google-auth-library-oauth2-http-1.20.0.jar,google-cloud-bigquerystorage-2.46.0.jar,google-cloud-core-2.27.0.jar,google-http-client-1.43.3.jar,google-http-client-apache-v2-1.42.3.jar,google-http-client-gson-1.43.3.jar,google-oauth-client-1.34.1.jar,GoogleBigQueryJDBC42.jar,grpc-alts-1.59.0.jar,grpc-api-1.59.0.jar,grpc-auth-1.59.0.jar,grpc-context-1.59.0.jar,grpc-core-1.59.0.jar,grpc-google-cloud-bigquerystorage-v1-2.46.0.jar,grpc-google-cloud-bigquerystorage-v1beta1-0.170.0.jar,grpc-google-cloud-bigquerystorage-v1beta2-0.170.0.jar,grpc-googleapis-1.59.0.jar,grpc-grpclb-1.59.0.jar,grpc-inprocess-1.59.0.jar,grpc-netty-shaded-1.59.0.jar,grpc-protobuf-1.59.0.jar,grpc-protobuf-lite-1.59.0.jar,grpc-stub-1.59.0.jar,grpc-util-1.59.0.jar,gson-2.10.1.jar,guava-32.1.2-jre.jar,httpclient-4.5.14.jar,httpcore-4.4.16.jar,j2objc-annotations-2.8.jar,jackson-annotations-2.14.2.jar,jackson-core-2.14.2.jar,jackson-databind-2.14.2.jar,javax.annotation-api-1.3.2.jar,joda-time-2.10.10.jar,json-20231013.jar,jsr305-3.0.2.jar,listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar,opencensus-api-0.31.1.jar,opencensus-contrib-http-util-0.31.1.jar,perfmark-api-0.26.0.jar,proto-google-cloud-bigquerystorage-v1-2.46.0.jar,proto-google-cloud-bigquerystorage-v1beta1-0.170.0.jar,proto-google-cloud-bigquerystorage-v1beta2-0.170.0.jar,proto-google-common-protos-2.28.0.jar,proto-google-iam-v1-1.23.0.jar,protobuf-java-3.24.4.jar,protobuf-java-util-3.24.4.jar,slf4j-api-1.7.36.jar,threetenbp-1.6.8.jar
{% endstep %}

{% step %}
You may get a CLASSPATH conflict regarding the JAR files.
{% endstep %}

{% step %}
Ensure the BigQuery connector Scala version matches your Spark Scala version.
{% endstep %}
{% endstepper %}

## Limitations

* A limitation exists where Spark is unable to process columns of DateTime data types from BigQuery, which causes it to incorrectly parse DateTime columns as string columns.
  * A possible workaround is to cast the DateTime column to timestamp so it processes as a timestamp column instead of a string.
* A limitation exists where Spark does not support decimal values with fixed precision greater than 38.
  * A possible workaround is to cast the data type as a string.
* The GEOGRAPHY column data type is not supported on Pushdown for BigQuery.
* When referencing quoted identifiers with backticks `` ` `` in the query connection, add `-corefetchmode` to the DQ Job command line to prevent the removal of the backticks `` ` `` at runtime.
* Using subqueires in a dataset query is currently unsupported. Instead, we recommend changing the query to a view.
