BigQuery

Data Source Setup Screen

On the BigQuery Data Source setup screen, theĀ Project IDĀ andĀ JSON Key FileĀ are always required. You can get a key file when you create a new service account with Google (details below).

  • If your database schema exceeds 5000 tokens, untick theĀ Load SchemaĀ box to stop Redash from loading it to the Query Editor screen. Many browsers will slow down or crash if the schema is too big.
  • Since BigQuery 2.0, BigQuery supports its Legacy SQL syntax orĀ Standard SQL Syntax. Redash supports both, but Standard SQL is the default. This preference applies at the Data Source level by toggling theĀ Use Standard SQLĀ box. Your selection here is passed to BigQuery along with your query text. If some of your queries use Legacy SQL and others use Standard SQL, you can create two Data Sources.
  • You can read more aboutĀ Processing LocationĀ here. If you receive a job not found an error that looks like this:Ā Not found: Job <project_id>:<job_id>, check that your Processing Location is correct.
  • If you enter aĀ Scanned Data Limit, Redash will perform a dry-run when you execute your query to check how much data will be processed. And if it is larger than the limit you specify, an error will appear.
  • TheĀ Maximum Billing TierĀ is an integer number that Redash can pass along to BigQuery via their API. SeeĀ their documentationĀ for more info.

How to create a Google Service Account?

  1. Open theĀ API Credentials Page. If prompted, select or create a project.
  2. Click the ā€œCreate credentialsā€ button. On the dropdown that appears, chose ā€œService account keyā€.
  3. On the following page, use the dropdown to select the project you elected in step 1. For role selectĀ BigQuery AdminĀ from the tree menu.
  4. Under key type, select JSON and hit ā€œCreateā€

AĀ .jsonĀ file will then download to your computer. Use this when setting up your Data Source.

BigQuery Permissions and Roles

If youā€™re using the predefined roles in BigQuery, you need to use the admin role since itā€™s the only one that can create queries and list tables.

Want to create your own role? The permissions you need to assign are:

  • bigquery.jobs.create
  • bigquery.jobs.get
  • bigquery.jobs.update
  • bigquery.datasets.get
  • bigquery.tables.list
  • bigquery.tables.get
  • bigquery.tables.getData