For the complete documentation index, see llms.txt. This page is also available as Markdown.

BigQuery

Steps

  1. Make sure the BigQuery project has the correct API enabled

  2. Create dedicated datasets

  3. Create a dedicated service account with the right set of permissions

  4. Generate a credentials JSON file

1. Enable Cloud Resource Manager API

  • In the Google Cloud Console, navigate to the APIs & Services > Library page.

  • In the search bar, type "Cloud Resource Manager API".

  • Click on the search result for the Cloud Resource Manager API and click the Enable button

2. Create dedicated datasets

We recommend to create two dedicated datasets for mediarithmics' usage.

  • mics_workspace dataset that holds all temporary tables created while syncing with your warehouse

  • mics_output dataset that holds all output tables — the clean results of daily processing, ready for consumption

CREATE SCHEMA IF NOT EXISTS `project-name.mics_workspace`
OPTIONS (
  location = 'EU',
  description = 'Working schema for mediarithmics'
);

CREATE SCHEMA IF NOT EXISTS `project-name.mics_output`
OPTIONS (
  location = 'EU',
  description = 'Output schema for mediarithmics'
);

Nota bene : If you wish to use a synchronization strategy that handles updates and deletes of data, you will need a working dataset (i.e. the mics_workspace dataset)

3. Service account creation and permissions

We recommend using a dedicated service account with the appropriate set of permissions.

To create a service account follow these steps :

  • Input the necessary informations : service account name, service account id (automatically generated), description. Click on “Create and continue”

Grant access

  • We recommend giving the service account Read only access to your data by giving the following roles at the project level :

    • bigquery.jobUser

    • bigquery.dataViewer

  • In addition, the service account should also have the following role on the mics_output and mics_workspace datasets

    • bigquery.dataEditor

Grant limited access

If you do not want to give the bigquery.dataViewer role at the project level, you can assign it only to specific datasets, tables or views in your project. If you do that then you should add the following permissions at the project level :

  • bigquery.datasets.get

  • bigquery.tables.list

  • bigquery.tables.get

To assign these customs permissions you should create a custom role than carries the bigquery.jobUser role and the bigquery.datasets.get bigquery.tables.list bigquery.tables.get permissions.

If the bigquery.dataViewer role is even too much, you can assign the bigquery.tables.getData permission at a table level only.

4. Generate a credentials JSON file

To export a credentials JSON file follow these steps :

  • Select JSON then “Create”

  • The key is automatically downloaded

Last updated

Was this helpful?