To integrate BigQuery with Abacus.AI, you need to set up the connector and provide the necessary permissions.
Access Abacus.AI Connected Services Dashboard:
- Go to the Abacus.AI Connected Services Dashboard. This is where you manage all your connected services.
- At the top-right of the page, click "Add New Connector" and select "BigQuery".
Enter Connector Information:
- Fill in the information captured in step 1 into the BigQuery connector window. This includes the Project ID and Dataset ID. Click Save
Configure Permissions in BigQuery:
- Set up the permissions in BigQuery by sharing the dataset with the service account as instructed in the step above and hit Verify.
Verify Connector Setup:
- You should see a screen that says your connector has been verified. Your BigQuery connector is now set up and ready to use.
Allowing write access back to BigQuery is always optional. If you choose to enable this, follow the instructions below based on whether you provided a dataset ID or not.
Navigate to Dataset: - Go to your dataset in the BigQuery Console.
Share Dataset: - Click "Share Dataset".
Add Roles: - Add the "BigQuery Data Viewer" role to the service account provided in the configuration instructions. - To allow Abacus.AI to write back to BigQuery, also add the "BigQuery Data Editor" and "BigQuery User" roles to the service account.
Navigate to IAM: - Go to the IAM Console for your project.
Add Service Account: - Click "Add" on the top of the page.
Add Roles: - Add the service account provided in the configuration instructions as a new principal with roles "BigQuery Data Viewer" and "BigQuery User". - To allow Abacus.AI to write back to BigQuery, also add the "BigQuery Data Editor" role to the service account.
Once the BigQuery connector is set up, you can fetch data to train models in Abacus.AI.
Read from External Service: - Choose "Read from External Service" and select your BigQuery connector under "Connected Application Connectors".
Enter Dataset Details: - Enter the details for the BigQuery dataset you want to use.
Configure Schema Mapping:
- After the dataset is uploaded, configure the schema mapping and proceed to train models with the data.
What if the dataset contains views and the views are querying tables in a different dataset that Abacus.AI is not granted permission to read from?
There are two suggested solutions:
Solution 1: Grant the service account access to the specific tables these views reference. Provide the "BigQuery Data Viewer" role to the specific underlying tables for the service account.
Solution 2: Create an Authorized View (https://cloud.google.com/bigquery/docs/authorized-views) which will grant the view access to the underlying data, allowing Abacus.AI to query from the view without having to grant permission to the table(s) which make up the view.