Google BigQuery
Type of Support: | Read & Write |
Validated On: | ODBC Client version 2.4.6.1015 |
Connection Type: | Alteryx Tool. The latest version is available from the Alteryx Community. |
Driver Details: |
Administrator action in Google Cloud might be necessary before configuring a connection in the Alteryx Google BigQuery tools. OAuth authentication supported with the Simba ODBC driver on DNS mode only. Google BigQuery requires OAuth as the authentication method. We support OAuth with the Simba ODBC driver through the DSN or in Alteryx using DCM. Get the Certified SIMBA driver from the Alteryx Downloads portal. |
Alteryx Tools Used to Connect
Standard Workflow Processing
In-database Workflow Processing
Note
In-database Workflow Processing is only supported using DCM.
Configure a Google BigQuery Bulk Connection
Using Google BigQuery Bulk is only supported while also using DCM. To use the bulk connection via the Output Data tool:
- Make sure the Data Connection Manager is enabled.
- Select Set Up a Connection and select Data Sources - Google BigQuery Bulk.
- Select Add a Data Source
- Enter a Data Source Name,
- Enter a Catalog (Project). This is the Google BigQuery Project ID that contains both the Dataset where the table will be written and the Google Cloud Storage bucket used for staging.
- Enter a Dataset. This is where the final table will be written.
- Enter a Bucket Name. This is the Google Cloud Storage staging location for bulk loading. The bucket has to be in the same location as the Project.
- Select Save.
- Select + Connect Credential. The same credential is used for staging in Cloud Storage as the Google BigQuery project.
- Select an Authentication Method,
- Follow the instructions for using OAuth Using DCM.
- Select Connect.
- Enter the table name and select OK.
OAuth Using DCM
You can set up authentication for Google BigQuery using OAuth integrated with DCM. This way you don't have to manually copy tokens to the ODBC driver.
Prerequisites
To set up OAuth you need:
- A valid DSN prepared with the Authenticator option set to OAuth,
- The OAuth authority URL, Port, Client ID, and Client Secret from the administrator.
Authentication Set Up
In Designer, drag the Input tool onto the canvas.
- Select the Use Data Connection Manager (DCM) checkbox.
- Select Set Up a Connection.
- In the Data Connections window, go to Data sources and choose Google BigQuery ODBC.
- The Connection Manager window opens. Select + Add Data Source.
- For Technology choose Google BigQuery ODBC with Simba.
- Fill in the Data Source Name and choose the prepared Google BigQuery DSN.
- Select Save.
- To link the credentials, select + Connect Credential.
- Choose OAuth as an Authentication Method.
- For OAuth Application choose to Create New Credential and fill in the information needed (get the OAuth authority URL, Port, Client ID, and Client Secret from the administrator).
- Choose to Create New Credential for OAuth Tokens.
- Fill in the Credential Name and select Create and Link.
- Select Connect.
- Sign in on the Google manager external browser window.
Additional Information
- Google BigQuery always quotes tables
- Appends happen by field name. If the name or data type don’t match, Google BigQuery throws an error
- Check Support Null Values in the format specific options (checked by default) to allow loading null data into Google BigQuery. If the option is not checked, Google BigQuery will reject null values.
- Extra columns in the target table will load as null if they are not included in Alteryx.
Output Connector Schemas
Field names and types passed to the Google BigQuery Output Tool must match those in the destination Google BigQuery table. Columns that exist in the Google BigQuery table but do not exist in the workflow field list will produce Null values for those columns in the inserted records. This will cause an error in the case where the destination column is not configured as NULLABLE.
Input Progress Indicator
In the case that there are rows in the streaming buffer for the selected table of an input tool without a custom query, the input tool will use the estimated number of rows in the streaming buffer reported by Google while updating the percentage of the progress indicator in a running workflow. If Google's estimate is incorrect, then the value reported in the progress indicator could be incorrect as well.
In the case that the table being queried is empty and the streaming buffer for that table is non-empty, then it is possible for Google to estimate the number of rows in the streaming buffer as zero. However, Google may still return rows from the streaming buffer. When this happens, you will not see the progress indicator percentage update, and a warning will display.
Configure a Connection Using Google BigQuery Tools
Authentication and Permissions
Contact your Google Cloud Administrator for help with your Google BigQuery credentials.
Since Designer version 22.1 there is an OAuth authentication supported with the Simba ODBC driver.
Service-to-Service Authentication Setup
You can obtain a service account JSON key file from the Google Cloud Console or you can create a new key for an existing service account. More information about Google BigQuery can be found on the Google Big Query Documentation site under Creating and Managing Service Account Keys.
End-User Authentication Setup
Obtain an OAuth client ID and secret from the credentials page of the Google Cloud Console. Ensure the client type is set to Other.
Note
Use Service-to-service authentication over End user authentication whenever possible. Managing distinct keys for various applications authenticating for the same service account allows the revocation of access for a specific application without requiring the other applications to update their authentication credentials.
Access Permissions
Permissions to read and write data within a Google BigQuery project service account must be granted via the Google Cloud Console. More information about permissions can be found on the Google Big Query Documentation site.
Known Limitations
Max Nested, Repeated Record Depth
Nested, repeated records are supported at a depth of one level. Nested, repeated records that are nested more than one level deep are not supported. More information about nested, repeated records, can be found on the Google BigQuery Documentation site.
Nested, Repeated Record Flattening
On Input
When pulling nested or repeated records from a Google BigQuery table, the Alteryx workflow will flatten the nexted and/or repeated records according to the following naming scheme:
A nested record nested_attr of the top-level column top_attr will create a new column named nr_top_attr_nexted_attr.
On Output
When pushing records from the Alteryx workflow to an existing Google BigQuery table, the need to fold record fields into nested and/or repeated records is specified by renaming record fields flowing into the ouput connector to follow these naming conventions.
A record nested_attr that should be nested onto the top-level column top_attr must be renamed to nr_top_attr_nested_attr.
A record nested_attr that should be nested and repeated an arbitrary number of times under the top-level column top_attr must be renamed to nrr_top_attr_{repetition_index}_nested_attr. Any repetitions that contain all NULL values on the nested fields are dropped before the API call to insert new rows to the Google BigQuery table. This implies that records in your designer workflow can have an arbitrary number of maximum repetitions, and not every record must have the same number of repetitions.