---
title: "Connect Pigment with Google BigQuery"
slug: "connect-google-bigquery"
description: "Learn to connect Google BigQuery datasets with Pigment, configure connections, and import query results seamlessly into your Pigment blocks."
updated: 2026-01-09T15:40:15Z
published: 2026-01-09T15:40:15Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://kb.pigment.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Pigment with Google BigQuery

![](https://cdn.document360.io/e47cfe35-dc28-40c7-a083-6cf003073d8e/Images/Documentation/image(17).png)

This article explains how to connect a Google BigQuery dataset with Pigment to retrieve any query result into a Pigment Block.

As with all other native Pigment integrations, you’ll first need to configure a Connection in the Integration library page. Once configured, this connection can be used by any Application that is authorized as a data source. These authorized Apps are defined during the ‘Import Data’ configuration step. Now, let’s see how to configure and use this native integration!

## Overview

This process starts in Google Cloud Platform, with the creation of a service account. Next, generate a Service Account Key and grant this service account access to the datasets containing the data you want to load in Pigment. Then, in Pigment, create a Connection and add the Key credentials. Once set up, you can input a SQL query and the Google BigQuery connector will load the result into your block.

> [!WARNING]
> **⚠️ Important**
> 
> You must have a Google BigQuery Dataset containing the data you want to load in Pigment.
> 
> You must have the [permissions](https://cloud.google.com/iam/docs/creating-managing-service-accounts#permissions) to create and manage access for the Google Cloud Service Account.
> 
> You must have the [permissions](https://cloud.google.com/iam/docs/granting-changing-revoking-access) to manage the service account’s access to the Google Cloud Projects containing the BigQuery Datasets you want to connect with.

## Preliminary steps on Google Cloud Platform

### GCP Step 1 - Creating an Service Account

Pigment uses a [**Service account**](https://cloud.google.com/iam/docs/service-accounts)****to authenticate to your GCP. For security reasons, we recommend a dedicated Service account for Pigment.

Follow [these steps](https://cloud.google.com/iam/docs/creating-managing-service-accounts#creating) to create a new Service Account.

![](https://cdn.document360.io/e47cfe35-dc28-40c7-a083-6cf003073d8e/Images/Documentation/6e097e75-74ef-46f0-ab95-6bbb2092a84c.png)

Name the service account. (ex: `Pigment`).

Grant the Service Account access to your project with a `BigQuery Job User` role.

A service account is created within a single Project, however you can [grant access for the service account](https://cloud.google.com/iam/docs/granting-changing-revoking-access#single-role) to multiple projects if you would like to retrieve data from other projects.

### GCP Step 2 - Generate a Service Account Key

Open the Service account you just created. Go to the **Keys**section and select **Add Key**then**Create new key**and select **JSON**. This downloads a **JSON** file. You need this file to configure the Connection on Pigment.

Pigment will read the BigQuery `project_id` for the project in which the service account was created from the JSON credentials file. If the service account has been granted access to the other projects, BigQuery will manage those credentials as well.

![](https://cdn.document360.io/e47cfe35-dc28-40c7-a083-6cf003073d8e/Images/Documentation/d5c28eb5-e81e-4756-8579-54af2d8cf049.png)

### GCP Step 3 - Configure BigQuery access for the Service Account

This step grants the Pigment service account access to the specific BigQuery datasets from which you would like to query data and load it into your Pigment block.

[Follow these steps](https://cloud.google.com/bigquery/docs/dataset-access-controls#granting_access_to_a_dataset) to grant access for your service account to each dataset containing data you would like to load into Pigment. In the **Select a role**section, select the `BigQuery Data Viewer` role.

Remember to grant access for datasets in other projects if needed.

## Setting up the BigQuery Connector in Pigment

Navigate to your **Integrations** page within Pigment (**Settings → Integrations)**. Locate the **BigQuery**integration and click on the **+ Add**button.

Click on **Set up a New Connection.**

![](https://cdn.document360.io/e47cfe35-dc28-40c7-a083-6cf003073d8e/Images/Documentation/7932f56f-13e1-4a57-8f35-9fdd2ac0e41e.png)

In the **Set up a new BigQuery connection**popup, name your connection.

Copy and paste into the **Credentials**section from the JSON file of the key that you created in **GCP Step 2 (Generate a Service Account Key).**

Select the specific applications in the **Application access**section for the applications containing the blocks you would like to connect with BigQuery for your data imports.

Click on **Setup**to finish the setup!

![](https://cdn.document360.io/e47cfe35-dc28-40c7-a083-6cf003073d8e/Images/Documentation/f89b051b-3bdb-4240-a337-a9c9699c1849.png)

## Load BigQuery data into Pigment

Within the import panel for your block, select **Integrations** and select the BigQuery connection you just created in the **Choose a connection**dropdown.

Now, you just need to input a **Query**and click on **Start Import**.

![](https://cdn.document360.io/e47cfe35-dc28-40c7-a083-6cf003073d8e/Images/Documentation/60ce48bf-acba-4bb2-acfa-b00ed463c002.png)

The result of the query should load in Pigment within a few seconds!

> ℹ️ **Note**
> 
> - [ARRAY data types](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#array_type) **are not** **supported**for the import – data from columns of this type will not be imported into Pigment. A query containing a column of ARRAY data type will contain NULL data in the import.
> - [STRUCT data type](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#struct_type)[s](http://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#struct_type) **are** **supported** for the import – a query containing nested data in STRUCT type will be imported into Pigment by flattening each nested field as separate columns.
