Google BigQuery

Google BigQuery is a fully-managed, serverless data warehouse that enables scalable analysis over petabytes of data. It is a Platform as a Service (PaaS) that supports querying using ANSI SQL.

A view can be exported as a table to a BigQuery dataset present on the Google Cloud Platform. For this export, you need to configure the Google Cloud first.

Enable BigQuery API

  1. Log in to Google Cloud Platform and select the project you want to use in Mammoth.

  2. Go to API and Services from the sidebar.

  3. Click on “+ Enable APIs and Services” and look for “BigQuery API”.

  4. Open BigQuery API and click on Enable.

    Enabling BigQuery API

    Fig. 54 Enabling BigQuery API

Create a Service Account

  1. From the sidebar, select IAM & Admin and go to Service accounts.

  2. Click on “Create service account.”

  3. In Service Account Details, enter the service account name and description. Google Cloud chooses an Email for your service account randomly. Click on Create.

    Service account

    Fig. 55 Creating a service account

  4. In Grant this service account access to project, add two roles and select BigQuery Data Editor and BigQuery Job User so that the service account has permission to complete specific actions on the resources in your project. Click Continue.

  5. In Grant users access to this service account, add the email address of the user you want to grant access to this service account. By default, you are the sole owner of the service account. This step is optional. Click Done.

    Adding roles

    Fig. 56 Adding roles to your service account.

  6. For the newly created service account, go to the action menu and select manage keys.

  7. Select Add key and click on Create new key.

  8. Select the key type as JSON as Mammoth accepts JSON type keys. Click on Create and a JSON key will be downloaded into your system. This JSON key will be required while connecting Mammoth to BigQuery.

    Creating a key

    Fig. 57 Creating a JSON key


A service account once created can be used for multiple projects.

  1. Switch to the project in which you want to add this service account.

  2. From the sidebar, go to IAM & Admin and click on “+ADD”

  3. Enter the email of the service account, create the roles and save it.

    Adding service account

    Fig. 58 Adding a service account to a project

Connect Mammoth to BigQuery

  1. In Mammoth, Select Data Preparation > Export > Google BigQuery.

  2. Upload the JSON key here that you had downloaded in the previous step.

    Uploading key

    Fig. 59 Uploading the downloaded JSON key


    Make sure that you have an existing Dataset in the Google Cloud project where the View can be exported as a table. To create a Dataset in BigQuery -

    1. Go to Google Cloud Console.

    2. Select Big Data > BigQuery from the sidebar.

    3. Select your project from Explorer tab, and click on Create Dataset option.

  3. Select the Dataset in which you want to export the data and enter the table name.

  4. Validate the connection and click on “Apply” once it turns green after the Validation. The the table will get exported to the selected Dataset.

    Export table

    Fig. 60 Exporting the table to BigQuery Dataset

On the Google Cloud Platform, select Google BigQuery from the sidebar. Select the same project for which you had generated the key and open the Dataset you had selected in Mammoth. You’ll have the table that you have exported from Mammoth!