Google BigQuery

Connect Tableau to Google BigQuery with the Google BigQuery and set up the data source.

Tableau provides two connectors for Google BigQuery:

  • Google BigQuery (JDBC): The current connector that uses the Simba JDBC driver.

  • Google BigQuery: The legacy connector.

This article covers how to connect using Google BigQuery (JDBC). If you need to use the older connector—including support for legacy SQL or bq-* customization attributes. For more information, see Older Google BigQuery connector.

Note: Some of the features and customizations listed in this article aren't supported in Tableau Prep Builder. For more information about connecting your data in Prep Builder, see Connect to Data(Link opens in a new window).

Before you begin

Before you begin, gather this connection information:

  • Google BigQuery email or phone, and password
  • For Google BigQuery (JDBC) only, the ID of the BigQuery project that is billed for the queries on the connection

Recommendation

Set up a custom OAuth Client to use your company's IT policies

You can fully control your OAuth configuration according to your own IT policies with a custom OAuth client. The option to use your own OAuth client frees you from being tied to Tableau release cycles and Tableau’s OAuth client rotation schedule. For information on how to configure your own OAuth client , see Configure Custom OAuth for a site.

Make the connection with Google BigQuery (JDBC) and set up the data source

Connect Tableau to Google BigQuery with the Google BigQuery (JDBC) connector and set up the data source so you can analyze that data in a workbook. This connector uses the Simba JDBC driver for BigQuery and supports standard SQL only. It doesn't support legacy SQL or the bq-* customization attributes.

BigQuery datasets are large. Connect live rather than extracting the data.

  1. To use a service account for a new Google BigQuery data source, create the connection in Tableau Desktop.

  2. Start Tableau and under Connect, select Google BigQuery (JDBC).

  3. In Billing Project ID, enter the ID of the BigQuery project that is billed for the queries on this connection.

  4. (Optional) Before you sign in, select the Advanced tab to set options for large result sets and for the project list. For more information, see Advanced Options for Google BigQuery (JDBC).

  5. Sign in with one of these methods.

Sign in with OAuth

In Authentication, select Sign in using OAuth.

  1. Select Sign In.

  2. Enter your password.

  3. Select Accept to allow Tableau to access your Google BigQuery data. Close the browser when prompted.

Sign in with a service account

To publish this data source, sign in to Tableau Server or Tableau Cloud first and save the service account credentials in your account settings. Otherwise publishing fails with an invalid-credentials error.

  1. In Authentication, select Sign in using Service Account.

  2. In Service Account JSON File, select Browse, and then select the JSON key file for your service account.

  3. Select Sign In.

On the data source page:

  1. (Optional) Select the default data source name at the top of the page, and then enter a unique name. Use a name that tells other users which data source to connect to.

  2. From the Project dropdown, select a project.

  3. From the Dataset dropdown, select a dataset.

  4. Under Table, select a table.

To connect to a specific query instead of the whole data source, use custom SQL. See Connect to a Custom SQL Query.

Starting with Tableau 2026.2, you can connect to spatial columns. See Connect to Spatial Data in a Database.

Google BigQuery doesn't support the Radians() function.

Advanced options for Google BigQuery (JDBC)

Set these options on the Advanced tab before you sign in. Each option applies to the Google BigQuery (JDBC) connector only.

  • Enable Large Result Dataset and Large Result Dataset: Have the driver write large result sets to destination tables in a BigQuery dataset. The destination dataset must be in the same region as the tables you query. This option is cleared by default. In Large Result Dataset, enter the dataset name. If you leave the box blank, Tableau uses _simba_jdbc. BigQuery storage pricing applies to the destination tables.

  • Enable Storage API (High Throughput API): Requires the BigQuery Storage API on the project you query and the BigQuery Read Session User role (roles/bigquery.readSessionUser). Ask your administrator to grant the role. When you select this option, the driver reads large result sets with the BigQuery Storage Read API instead of the standard BigQuery API. This option is cleared by default. BigQuery Storage Read API pricing applies to these reads. For best performance, don't select Enable Large Result Dataset when you use this option.

  • High Throughput Activation Ratio and High Throughput Min Table Size: The driver switches to the Storage Read API only when a query result has more pages than High Throughput Activation Ratio and more rows than High Throughput Min Table Size. Tableau passes these values to the driver only when Enable Storage API (High Throughput API) is selected. If you leave a box blank, the driver uses its default value.

  • Enumerate All Projects: Selected by default. When selected, Tableau retrieves the projects to show in the Project list on the data source page. To connect to one project without retrieving the list, clear Enumerate All Projects, and then enter the project ID. If you clear Enumerate All Projects and leave the project ID empty, the connection fails and Tableau reports that the project ID can't be empty.

For the Storage Read API, large result sets, and pricing, see Use the Simba ODBC and JDBC Drivers for BigQuery in Google's documentation.

Older Google BigQuery connector

The older Google BigQuery connector, shown as Google BigQuery in the Connect pane, connects through the BigQuery REST API and supports both standard SQL and legacy SQL. Google BigQuery (JDBC) supports standard SQL only. The bq-* customization attributes and the Use Legacy SQL option described in this section apply to the older connector only.

Connect to Google BigQuery with the older connector

Note:To use service account credentials for a new Google BigQuery data source, the connection must be created in Tableau Desktop.

  1. Start Tableau and under Connect, select Google BigQuery.

    Complete one of the following 2 options to continue.

    Option 1:

    1. In Authentication, select Sign In using OAuth.
    2. Click Sign In.
    3. Enter your password to continue.
    4. Select Accept to allow Tableau to access your Google BigQuery data. You’ll be prompted to close the browser.

    Google BigQuery authentication window with Sign in using OAuth selected for the Authentication dropdown.

    Option 2:

    Tip: If you’re using Tableau Server or Tableau Cloud for publishing, you have to start with logging into the product you’re using, and then add your saved Google BigQuery credentials under account settings. This prevents an “Invalid credentials error”.

    1. In Authentication, select Sign In using the Service Account (JSON) file.
    2. Enter the file path or use the Browse button to search for it.
    3. Click Sign In.
  2. Google BigQuery authentication window with Sign in using Service Account selected for the Authentication dropdown.

     

  3. On the data source page, do the following:

    1. (Optional) Select the default data source name at the top of the page, and then enter a unique data source name for use in Tableau. For example, use a data source naming convention that helps other users of the data source figure out which data source to connect to.

    2. (Optional) From the Billing Project dropdown list, select a billing project. If you don't select a billing project, EmptyProject appears in the field after you’ve selected the remaining fields.

    3. From the Project dropdown list, select a project. Alternatively, select publicdata to connect to sample data in BigQuery.

    4. From the Dataset dropdown list, select a data set.

    5. Under Table, select a table.

      Use custom SQL to connect to a specific query rather than the entire data source. For more information, see Connect to a Custom SQL Query.

      Note: Starting with Tableau version 2026.2, you can connect to spatial columns. For more information, see Connect to Spatial Data in a Database.

Notes:
- Google BigQuery has changed support from BigQuery legacy SQL (BQL) to standard SQL. Your workbooks upgrade to support standard SQL when you open them in Tableau.
- Because of the large volume of data in BigQuery, Tableau recommends that you connect live.
- The Radians() function isn’t supported in Google BigQuery.

Use customization attributes to improve query performance

The bq-* customization attributes apply to the older Google BigQuery connector.

Note: Customization attributes aren't currently supported in Tableau Prep Builder.

You can use customization attributes to improve the performance of large result sets returned from BigQuery to Tableau Cloud, Tableau Server, and on Tableau Desktop.

You can have the customization attributes included in your published workbook or data source, as long as you specify the attributes before you publish the workbook or data source to Tableau Cloud or Tableau Server.

Use Google BigQuery customization attributes

Customization attributes accept integer values and affect both live queries and extract refreshes for the specified connection.

The following attributes help the most to increase the performance of large result sets:

bq-fetch-tasks Number of parallel background tasks to use when fetching data using HTTP. The default is 10.
bq-large-fetch-rows

Number of rows to fetch in each batch for spool queries. The default is 50000.

The following attributes are also available and are used for small queries:

bq-fetch-rows Number of rows to fetch in each batch for non-spool queries. The default is 10000.
bq-response-rows Number of rows returned in non-spool non-batched queries. The default is 10000.

This capability setting accepts yes or no values and can be useful when testing:

CAP_BIGQUERY_FORCE_SPOOL_JOB Force all queries to use the temp table approach. The default value is “no.” Change the value to “yes” to turn on this attribute.

How Tableau returns rows from Google BigQuery

Tableau uses two approaches to return rows from BigQuery: the default non-spool approach, or the temp table (spool) approach:

  • On the first attempt, queries are executed using the default, non-spool query, which uses the bq-fetch-rows setting.

  • If the result set is too large, the BigQuery API returns an error and the Tableau BigQuery connector retries the query by saving the results into a BigQuery temp table. The BigQuery connector then reads from that temp table, which is a spool job that uses the bq-large-fetch-rows setting.

How to specify the attributes

Specify these attributes in a Tableau Datasource Customization (.tdc) file, or in the workbook or data source XML.

Specify attributes in a .tdc file

To specify customization attributes during a publish workbook or publish data source operation from Tableau Desktop, follow these steps:

  1. Create an XML file that contains the customization attributes.

  2. Save the file with a .tdc extension, for example, BigQueryCustomization.tdc.

  3. Save the file to the My Tableau Repository\Datasources folder.

The customization attributes in the .tdc files are read and included by Tableau Desktop when the data source or workbook is published to Tableau Cloud or Tableau Server.

Important: TDC files can be utilized to customize the functionality of a connection or to diagnose and resolve issues related to connecting to your data. Tableau is unable to thoroughly test every potential modification you might make with these files. Creating and using TDC files requires manual editing and it is crucial to test them thoroughly before deploying them in a production environment.

Example of a .tdc file with recommended settings for large extracts
<connection-customization class='bigquery' enabled='true' version='8.0' >
  <vendor name='bigquery' />
  <driver name='bigquery' />
  <customizations>
    <customization name='bq-fetch-tasks' value='10' />
    <customization name='bq-large-fetch-rows' value='10000' />
  </customizations>
</connection-customization>

Manually embed attributes in the XML of the workbook or data source file

You can manually embed customization attributes inside the 'connection' tag in the workbook.twb file or the data source .tds file. The BigQuery customization attributes are bold in the following example to make them easier for you to see.

Example of manually embedded attributes

<connection CATALOG='publicdata' EXECCATALOG='some-project-123' REDIRECT_URI='some-url:2.0:oob' SCOPE='https://www.googleapis.com/auth/bigquery https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email' authentication='yes' bq-fetch-tasks='10' bq-large-fetch-rows='10000'bq_schema='samples' class='bigquery' connection-dialect='google-bql' connection-protocol='native-api' login_title='Sign in to Google BigQuery' odbc-connect-string-extras='' project='publicdata' schema='samples' server='googleapis.com/bigquery' server-oauth='' table='wikipedia' username=''>

Check if your workbook uses standard SQL or legacy SQL

In 2016, Google updated the BigQuery APIs to support standard SQL, in addition to still supporting BigQuery SQL (now called legacy SQL). Starting in Tableau 10.1, the Google BigQuery connector has been upgraded to support standard SQL, and also still supports legacy SQL. Standard SQL enables users of the BigQuery connector to use level of detail expressions, get faster metadata validation, and select a billing project with the connection.

Now, when you create a workbook, Tableau supports standard SQL by default. Tableau also supports legacy SQL using the Use Legacy SQL option on the Data pane. For example, when you open a workbook that was created using a previous version of Tableau Desktop, and if your workbook uses legacy SQL, the Use Legacy SQL option is selected.

If you configure the Use Legacy SQL option for the following reasons:

  • You have an existing workbook that you want to update to use standard SQL to write level of detail expressions or to take advantage of other improvements. In this case, make sure that the Use Legacy SQL option isn’t selected.

  • You’re creating a workbook that must connect to a legacy SQL view. You can’t mix legacy SQL with standard SQL, so you must select the Use Legacy SQL option for the workbook to function.

In Google BigQuery, views are written in standard SQL or legacy SQL. You can join views written in standard SQL to views written in standard SQL, or views written in legacy SQL to views written in legacy SQL, and you can join views written in either version of SQL to a table. But you can’t join views written in standard SQL and views written in legacy SQL in one workbook. When you join views, you must set the Use Legacy SQL check box to correspond to the SQL type used in the view you’re connecting to.

Note: Tableau Desktop provides limited support for nested data when you use legacy SQL or standard SQL. For example, if a table contains nested data and you're using legacy SQL or standard SQL, on the data source page, Update Now won't work.

For more information about migrating from legacy SQL to standard SQL, see Migrating from legacy SQL(Link opens in a new window) on the Google Cloud Platform website.

Use BigQuery BI Engine to Analyze Data

You can use BigQuery BI Engine to perform fast, low-latency analysis services and interactive analytics with reports and dashboards backed by BigQuery. For more information, including instructions on how to integrate BigQuery BI Engine with Tableau, see Analyze BigQuery data with BI Engine and Tableau Desktop(Link opens in a new window) in Google's documentation.

Troubleshoot Google BigQuery issues

Connections to multiple accounts

When using web authoring or publishing to the web, you can’t use multiple Google BigQuery accounts in the same workbook. You can have multiple Google BigQuery account connections in Tableau Desktop.

When publishing flows, the credentials that you use to connect to Google BigQuery in your Input step must match the credentials that are set up in the Settings tab in the My Account Settings page for Google BigQuery in Tableau Server or Tableau Cloud. If you select different credentials or no credentials in your authentication setting when publishing the flow, the flow fails with an authentication error until you edit the connection for the flow in Tableau Server or Tableau Cloud to match those credentials.

Web authoring with Internet Explorer 11 and Edge

In Internet Explorer 11 and Edge, you can’t access a server using an unsecured connection (http). Use a secure connection (https) or switch to another browser.

Tables that require a partition filter

If a partitioned table in BigQuery has the Require partition filter setting, every query on that table must include at least one predicate that only references the partitioning column. This requirement also applies to queries on views and materialized views that reference the partitioned table. Queries without such a predicate return an error like the following, where project_id.dataset.table is the table name:

Cannot query over table 'project_id.dataset.table' without a filter that can be used for partition elimination

For more information, see Set partition filter requirements in Google's documentation.

See also

Thanks for your feedback!Your feedback has been successfully submitted. Thank you!