# BigQuery

> Connect Google BigQuery and replicate datasets and tables into your Filament warehouse for analysis.

BigQuery holds the tables your team has built, but putting them next to the rest of your data usually means another export or more SQL.

Filament replicates the BigQuery tables you choose straight into your warehouse, so you can explore them and join them to your other connected tools in plain English.

## Data we sync

- **Selected Tables**: The full rows of each BigQuery table you choose, replicated into your warehouse with their original columns and types. STRUCT, ARRAY and JSON fields are stored as JSON. (`all table columns`, `_first_synced_at`)

## How do I connect BigQuery?

You need a Google Cloud project with the **BigQuery API enabled**, and permission to create a service account and JSON key. Use a dedicated account with **BigQuery Job User** on the project and **BigQuery Data Viewer** access to the datasets you want to sync.

### Prepare the service account

1. In Google Cloud Console, select your project. Under **APIs & Services → Library**, find and enable **BigQuery API** if needed.
2. Open **IAM & Admin → Service Accounts → Create service account**. Name the account and grant **BigQuery Job User** on the project.
3. In BigQuery, select each required dataset and use its **Sharing → Permissions** controls to grant **BigQuery Data Viewer** to the service account’s email address.
4. Return to the service account and open **Keys → Add key → Create new key**. Choose **JSON**, create the key and keep the downloaded file private. If your organisation blocks key creation, ask your Google Cloud administrator to review the policy.

### Connect in Filament

1. Open [Apps](https://filamentanalytics.com/apps) in Filament and add **BigQuery**.
2. Paste the complete service account JSON key. Filament verifies it before saving.
3. Choose a dataset and the tables to replicate. Only stored tables are listed; views and external tables are excluded.
4. Add any useful context about your data and complete setup.
