BigQuery
This guide walks you through connecting a Google BigQuery dataset to Roundtable so the AI can query your data using the query_bigquery tool.
Prerequisites
Before you begin, make sure you have:
- A Google Cloud project with the BigQuery API enabled.
- A BigQuery dataset containing the tables you want to query.
- Owner or Editor permissions on the GCP project (to create a service account).
- Admin access to your Roundtable organization (to create connections).
Step 1: Create a Service Account
The service account gives Roundtable read-only access to your BigQuery data.
- Open the Google Cloud Console.
- Select your project from the project picker.
- Navigate to IAM & Admin → Service Accounts.
- Click Create Service Account.
- Enter a name (e.g.,
roundtable-bigquery-reader). - Click Create and Continue.
- Grant the service account the BigQuery Data Viewer role.
- This role provides read-only access to table data and metadata.
- If you also want the AI to see dataset and table listings, add the BigQuery Metadata Viewer role.
- Click Done.
Follow the principle of least privilege. The BigQuery Data Viewer role allows SELECT queries but prevents any data modification. Only add additional roles if your use case requires them.
Step 2: Download the JSON Key
- In the Service Accounts list, click the service account you just created.
- Go to the Keys tab.
- Click Add Key → Create New Key.
- Select JSON as the key type.
- Click Create.
A .json file will download to your machine. This file contains the private key that Roundtable will use to authenticate. Keep it secure.
Treat this JSON key like a password. Do not commit it to version control, share it in chat, or store it in an unsecured location. After uploading it to Roundtable, you can delete the local copy.
Step 3: Add the Connection in Roundtable
- Go to your Roundtable organization's Settings → Connections.
- Click Add Connection.
- Select BigQuery as the connection type.
- Fill in the required fields:
| Field | Description | Example |
|---|---|---|
| Connection Name | A friendly label for this connection | Production BigQuery |
| Project ID | Your GCP project ID | my-company-analytics |
| Dataset | The default BigQuery dataset to query | analytics |
| Service Account Key | The JSON key file contents | Paste or upload the .json file |
- Click Save.
Step 4: Test the Connection
After saving, click the Test Connection button. Roundtable will:
- Authenticate with BigQuery using the service account key.
- Verify that the specified project and dataset exist.
- Confirm that the service account has read permissions.
If the test succeeds, you'll see a green checkmark. If it fails, the error message will indicate the issue — common problems include:
| Error | Cause | Fix |
|---|---|---|
Permission denied | Service account lacks the required role | Add BigQuery Data Viewer role |
Dataset not found | Typo in dataset name or wrong project | Double-check project ID and dataset name |
Invalid key | Malformed or expired JSON key | Generate a new key and re-upload |
Step 5: Attach to a Workspace
- Open the workspace where you want BigQuery access.
- Go to Settings → Connections.
- Select your BigQuery connection from the dropdown.
- Click Save.
The query_bigquery tool is now active in this workspace.
Example: Querying Your Data
Once the connection is live, workspace members can ask the AI to query BigQuery in natural language:
User:
What were the top 5 products by revenue last month?
AI response (using query_bigquery):
The AI will:
- Generate a SQL query like:
SELECT product_name, SUM(revenue) AS total_revenueFROM `my-company-analytics.analytics.orders`WHERE DATE(order_date) >= DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH)GROUP BY product_nameORDER BY total_revenue DESCLIMIT 5
- Execute the query against your BigQuery dataset.
- Return the results in a formatted table with a plain-language summary.
Give the AI context about your schema in the system prompt. When the AI knows your table names, column types, and business terminology, it writes more accurate queries on the first try.