Skip to main content

BigQuery

Requirements

To connect DataChat to your BigQuery project, you’ll need:

  • Project name
  • Dataset name
  • Key file (for service accounts)

Permissions

To connect to BigQuery, your account must have the following permissions:

  • BigQuery Data Viewer. Grants read access to specific tables or views.
  • BigQuery Job User. Grants permission to run jobs at the dataset level.

If you plan to use BigQuery ML, ensure the account has the following permissions:

  • bigquery.jobs.create
  • bigquery.models.create
  • bigquery.models.getData
  • bigquery.models.updateData
  • bigquery.models.updateMetadata
  • bigquery.models.delete

For more information on BigQuery ML permissions, see Google Cloud's documentation.

Connection Methods

OAuth

Refer to Enable Database OAuth for more information.

Service Accounts

If you're using a service account to connect to BigQuery, follow these steps before connecting in DataChat:

Create a service account

  1. In the Google Cloud Console, go to IAM & Admin > Service Accounts.
  2. Click Create Service Account.
  3. Enter a name (e.g., datachat-access) and click Create.
  4. Ensure the service account has the necessary permissions.

Download the Key File

  1. In the Service Accounts list, click the name of your new account.
  2. Go to the Keys tab, then click Add Key > Create new key.
  3. Select JSON and click Create. The file will download automatically. Keep this file secure as it won’t be downloadable again.

Add Your BigQuery Database

To add your BigQuery database:

Big Query database

  1. Give the database a display name. This is how you'll reference the database across DataChat.
  2. In the Project field, enter the name of your BigQuery project.
  3. In the Dataset Name field, enter the name of your BigQuery dataset.
  4. Select whether this connection will use a service account or connect to BigQuery via OAuth.
  5. If this connection uses a service account, upload your key file.
  6. Optionally, set the database to be read-only.
  7. Optionally, enable using BigQuery's storage API. Note that selecting this option can improve performance when interacting with your BigQuery tables, but may result in increased BigQuery costs.
  8. Test your database, then click Save.