Menu Close
v0.33.5 / Administration-Guide / Databases

Working with Google BigQuery in Metabase

Starting in v0.15.0 Metabase provides a driver for connecting to BigQuery directly and executing queries against any datasets you have. The below sections provide information on how to get connected and troubleshoot any issues that may come up.

Connecting to a BigQuery Dataset

  1. make sure you have a Google Cloud Platform account with a Project you would like to use in Metabase.
    • Start by giving this connection a Name and providing your Google Cloud Platform Project ID along with your desired BigQuery Dataset ID. If you don’t have a dataset and want to play around with something we recommend copying one of the sample tables Basic Fields
    • Follow the Click here link provided below the Client ID field which will open a new browser tab and guide you through the process of generating OAuth 2.0 credentials for Metabase. Make sure to choose Other for your application type. Client ID
    • take the resulting client ID and client secret and copy them over to Metabase. Client Details
    • Now follow the link below the Auth Code field for Click here to get an auth code which will open a new browser window and authorize your credentials for a BigQuery access token to use the api. Simply click the Allow button. Generating an Auth Code
    • Copy the resulting code provided into the Auth Code field in Metabase. Copying the Auth Code
    • Click the Save button!

Metabase will now begin inspecting your BigQuery Dataset and finding any tables and fields to build up a sense for the schema. Give it a little bit of time to do its work and then you’re all set to start querying.

Using Legacy SQL

As of version 0.30.0, Metabase tells BigQuery to interpret SQL queries as Standard SQL. If you prefer using Legacy SQL instead, you can tell Metabase to do so by including a #legacySQL directive at the beginning of your query, for example:

#legacySQL
SELECT *
FROM [my_dataset.my_table]