Sources
Bigquery
How to configure your Bigquery warehouse
Install
Run the following command to install the connector from the root of your project:
How to configure sources
The sources files must be inside the queries/
folder.
To know how the source hierarchy works, please, visit How to configure sources.
Configuration
To configure the connection with your Bigquery database follow these steps:
1
Create the source `.yaml` file within the `queries` folder if you haven't already
/queries/source.yml
2
Add the following code for your Bigquery connection
3
Replace the details section with your info and save
4
Done, now you can test your connection
Attributes
- project_id → The unique identifier for your Google Cloud project. It’s like the address for where all your BigQuery activities live, helping Google know which project your data and queries belong to.
- credentials → (Optional) To connect via service account authentication
- clientEmail -> Your service account email
- privateKey -> Your service account private key
- token → (Optional) To connect with Oauth client ID authentication. This is Oauth’s access token, which can be generated with gcloud’s cli:
gcloud auth print-access-token
For authentication, you’ll either have to choose the Credentials
or Token
approach. In case both are defined, Credentials approach takes preference.
Test connection
To test the connection you can:
- Create a query
.sql
in thequeries
directory that points to a table of your new connection in theFROM
clause. See the section SQL Syntax Basics to learn more. - Use the command line to run
latitude run query_file_name
wherequery_file_name
is the name of your.sql
file. This will display the results in your terminal. See the section Running queries to learn more about how to query your data.