Connecting to BigQuery
This guide explains how to connect Genesis to Google BigQuery using service account authentication.
Authentication Setup
Go to Google Cloud Console
Access the concole here
Selecting/Creating Your Project
To select or create your project, note your PROJECT_ID (in all lower case)
Navigate To Service Accounts
Navigate to “IAM & Admin” > “Service Accounts”
Creating A Service Account
Click “Create Service Account”
Fill In The Details
Fill in the required details:
-
Name: (e.g., “genesis-bigquery-sa”)
-
Description: Optional
Grant The Following Roles
-
BigQuery Data Viewer
-
BigQuery Job User
-
BigQuery User
Creating And Downloading The JSON Key File
-
Go to the “Keys” tab
-
Click “Add Key” > “Create new key”
-
Choose JSON format
NOTE: The downloaded key file will contain your service account credentials including project_id, private_key, client_email and other necessary authentication details.
Environment Variable Setup
Before connecting, set the GOOGLE_APPLICATION_CREDENTIALS
environment variable to your key file path
Reference Example:
IMPORTANT: Make sure you set this before running the Genesis server and set it in the same terminal window where you will be running Genesis.
Test Harness Available
In the /database_demos/bigquery folder that gets installed with Genesis, you can find an additional readme and a small Python program that can be used as a test harness to confirm that your BigQuery connection is working. You can use this if you have any issues connecting to BigQuery with the procedure below.
Adding BigQuery Connection in Genesis
Tell Eve to add the BigQuery connection using this format.
Make sure your lowercase is in all lowercase.
Copy the prompt below to follow along
Reference Example:
Example Used:
Eve adds a connection to BigQuery
Check your Database Connections
After setting up the connection, verify it on the Database Connections tab in the Genesis GUI.
my_bigquery and other databases connected appear here
See What Schemas Are Visible In Your Project
Copy the prompt below to follow along
Eve listing the Project ID and Schema Names visible in the connection
Adding BigQuery Datasets To The Harvest
You can harvest specific datasets by asking Eve to add all visible schemas, or you can list specific schemas.
Copy the prompt below to follow along
Eve adding my_bigquery to the harvest
After a few minutes, you can see results of the harvest on the Config / Harvester Summary page in the Genesis GUI.
Harvester Status is where you can see all of the data sources being harvested
In this case, there is only one table in one of these datasets, called random_numbers.
Let’s ask Eve to search for it.
Copy the prompt below to follow along
Using the SearchMetadata tool she can now find this table and knows where it is located
Removing The Connection
You also have the option to remove the connection.
NOTE: This will also remove related harvest information