> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.polytomic.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.polytomic.com/_mcp/server.

# Google BigQuery

Supports:
* ✅ Models
* ✅ Model sync destination
* ✅ Bulk sync source
* ✅ Bulk sync destination


## Connection

### Configuration
<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>auth_method</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Authentication method<br/><br/>Accepted values: `service_account_key` <a href="#auth-method-service-account-key">↓</a>, `workload_identity_federation` <a href="#auth-method-workload-identity-federation">↓</a>, `application_default_credentials`</td>
<td><code>required</code></td>
</tr>
<tr>
<td><code>location</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Location (optional)<br/><br/>Region or multi-region for query operations</td>
<td><code>optional</code></td>
</tr>
<tr>
<td><code>structured_values_as_json</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Write object and array values as JSON</td>
<td><code>optional</code></td>
</tr>
<tr>
<td><code>use_bulk_sync_staging_schema</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Use custom bulk sync staging schema <a href="#use-bulk-sync-staging-schema-true">↓</a></td>
<td><code>optional</code></td>
</tr>
<tr>
<td><code>use_extract</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Use extract for bulk sync from BigQuery <a href="#use-extract-true">↓</a></td>
<td><code>optional</code></td>
</tr>
</tbody>
</table>

<a id="auth-method-service-account-key"></a>

#### `auth_method`

When `auth_method` is `service_account_key`:

<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>service_account</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Service account key</td>
<td><code>required</code></td>
</tr>
</tbody>
</table>

<table>
<thead>
<tr>
<th>Read-only property</th><th>Type</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>client_email</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Service account identity</td>
</tr>
<tr>
<td><code>project_id</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Service account project ID</td>
</tr>
</tbody>
</table>

```json
{
  "name": "Google BigQuery connection",
  "type": "bigquery",
  "configuration": {
    "auth_method": "service_account_key",
    "location": "us-east1",
    "service_account": "",
    "structured_values_as_json": false,
    "use_bulk_sync_staging_schema": false,
    "use_extract": false
  }
}
```

<a id="auth-method-workload-identity-federation"></a>

When `auth_method` is `workload_identity_federation`:

<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>credential_config</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Credential configuration JSON file downloaded from Google Cloud</td>
<td><code>required</code></td>
</tr>
<tr>
<td><code>wif_project_id</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Google Cloud project ID</td>
<td><code>required</code></td>
</tr>
</tbody>
</table>

```json
{
  "name": "Google BigQuery connection",
  "type": "bigquery",
  "configuration": {
    "auth_method": "workload_identity_federation",
    "credential_config": "",
    "location": "us-east1",
    "structured_values_as_json": false,
    "use_bulk_sync_staging_schema": false,
    "use_extract": false,
    "wif_project_id": ""
  }
}
```

<a id="auth-method-service-account-key|application-default-credentials"></a>

When `auth_method` is `service_account_key|application_default_credentials`:

<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>override_project_id</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Override project ID (optional)<br/><br/>Override the default project ID for cross-project access</td>
<td><code>optional</code></td>
</tr>
</tbody>
</table>

```json
{
  "name": "Google BigQuery connection",
  "type": "bigquery",
  "configuration": {
    "auth_method": "service_account_key|application_default_credentials",
    "location": "us-east1",
    "override_project_id": "",
    "structured_values_as_json": false,
    "use_bulk_sync_staging_schema": false,
    "use_extract": false
  }
}
```

<a id="use-bulk-sync-staging-schema-true"></a>

#### `use_bulk_sync_staging_schema`

When `use_bulk_sync_staging_schema` is `true`:

<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>bulk_sync_staging_schema</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Staging schema name</td>
<td><code>required</code></td>
</tr>
</tbody>
</table>

```json
{
  "name": "Google BigQuery connection",
  "type": "bigquery",
  "configuration": {
    "auth_method": "service_account_key",
    "bulk_sync_staging_schema": "",
    "location": "us-east1",
    "service_account": "",
    "structured_values_as_json": false,
    "use_bulk_sync_staging_schema": true,
    "use_extract": false
  }
}
```

<a id="use-extract-true"></a>

#### `use_extract`

When `use_extract` is `true`:

<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>bucket</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Google Cloud Storage bucket</td>
<td><code>required</code></td>
</tr>
</tbody>
</table>

```json
{
  "name": "Google BigQuery connection",
  "type": "bigquery",
  "configuration": {
    "auth_method": "service_account_key",
    "bucket": "my-bucket",
    "location": "us-east1",
    "service_account": "",
    "structured_values_as_json": false,
    "use_bulk_sync_staging_schema": false,
    "use_extract": true
  }
}
```



## Model Sync
### Source
#### Configuration
<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>dataset</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Dataset</td>
<td><code>optional</code></td>
</tr>
<tr>
<td><code>query</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;"></td>
<td><code>optional</code></td>
</tr>
<tr>
<td><code>table</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Table</td>
<td><code>optional</code></td>
</tr>
</tbody>
</table>


#### Example
```json
{
  ...
  "configuration": {
    "dataset": "nyctaxi",
    "query": "SELECT * from sampledata.nyctaxi.taxis",
    "table": "taxis"
  }
}
```


### Target
Google BigQuery connections may be used as the destination in a model sync.




### Target creation

Google BigQuery connections may be used to create a new target for a model sync. The
following parameters are required to create a new target:

<table>
<thead>
<tr>
  <th>NAME</th>
  <th>DESCRIPTION</th>
  <th>ENUM</th>
</tr></thead>
<tbody>
<tr>
  <td>dataset</td>
  <td>Dataset</td>
  <td>true</td>
</tr>

<tr>
  <td>name</td>
  <td>Table name</td>
  <td>false</td>
</tr>

</tbody>
</table>




## Bulk Sync
### Source
Google BigQuery connections may be used as a bulk sync source. No additional configuration options are required.

### Destination
#### Configuration
<table>
<thead>
<tr>
<th>Name</th><th>Type</th><th>Description</th><th>Required</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>advanced</code></td>
<td><code>object</code></td>
<td style="vertical-align: top;"></td>
<td><code>optional</code></td>
</tr>
<tr>
<td><code>dataset</code></td>
<td><code>string</code></td>
<td style="vertical-align: top;">Output dataset</td>
<td><code>optional</code></td>
</tr>
<tr>
<td><code>mirror_schemas</code></td>
<td><code>boolean</code></td>
<td style="vertical-align: top;">Mirror schemas</td>
<td><code>optional</code></td>
</tr>
</tbody>
</table>


#### Example
```json
{
  ...
  "destination_configuration": {
    "advanced": {
        "empty_strings_null": true,
        "expire_tables_after_inactivity": false,
        "hard_deletes": false,
        "initial_execution": "rebuild",
        "table_expiry_days": 0,
        "table_prefix": "",
        "truncate_existing": false
    },
    "dataset": "dataset",
    "mirror_schemas": false
  }
}
```



## Type handling
### Destination types
|       POLYTOMIC TYPE        |     GOOGLE BIGQUERY TYPE      |
|-----------------------------|-------------------------------|
| `array<>`                   | `JSON`                        |
| `bigint`                    | `INTEGER`                     |
| `boolean`                   | `BOOLEAN`                     |
| `date`                      | `DATE`                        |
| `datetime`                  | `TIMESTAMP`                   |
| `decimal(precision, scale)` | `BIGNUMERIC(precision,scale)` |
| `double`                    | `FLOAT`                       |
| `int`                       | `INTEGER`                     |
| `json`                      | `JSON`                        |
| `jsonarray`                 | `JSON`                        |
| `number`                    | `BIGNUMERIC`                  |
| `object{}`                  | `JSON`                        |
| `single`                    | `FLOAT`                       |
| `smallint`                  | `INTEGER`                     |
| `string`                    | `STRING`                      |
| `time`                      | `TIME`                        |


### Source types
|      GOOGLE BIGQUERY TYPE      |       POLYTOMIC TYPE        |
|--------------------------------|-----------------------------|
| `ARRAY<>`                      | `array<>`                   |
| `BIGNUMERIC`                   | `number`                    |
| `BIGNUMERIC(precision, scale)` | `decimal(precision, scale)` |
| `DATE`                         | `date`                      |
| `FLOAT`                        | `double`                    |
| `INTEGER`                      | `bigint`                    |
| `NUMERIC`                      | `number`                    |
| `NUMERIC(precision, scale)`    | `decimal(precision, scale)` |
| `RECORD`                       | `json`                      |
| `RECORD<>`                     | `object{}`                  |
| `TIME`                         | `time`                      |
| `TIMESTAMP`                    | `datetime`                  |