You are here:
Google BigQuery for Legacy SQL Connection
Create a remote connection using the Google BigQuery connector to sync data from Google BigQuery to CRM Analytics.
Connection Requirements
The service account that you use to connect to Google Big Query must have the standard role "BigQuery Data Viewer" and a custom role with these permissions.
- bigquery.jobs.create
- bigquery.jobs.get
- bigquery.jobs.list
- bigquery.jobs.listAll
- bigquery.jobs.update
- bigquery.tables.create
- bigquery.tables.delete
- bigquery.tables.update
- bigquery.tables.updateData
- storage.buckets.list
Account creation generates a JSON file of account properties. Most of the necessary connection settings are in this file. For more information about viewing and downloading service account details, see Google’s Creating and managing service account keys documentation.
Create Connection
- On the Data Manager Connections tab, click New Connection.
- Click the name of the connector, and click Next.
- Enter the connector settings.
- To validate your settings and attempt to connect to the source, click Save & Test. If the connection fails, CRM Analytics shows possible reasons.
All settings require a value, unless otherwise indicated.
| Connection Setting | Description |
|---|---|
| Connection Name | Identifies the connections. Use a convention that lets you easily distinguish between different connections. |
| Developer Name | API name for the connection. This name can’t include spaces. The API name is used in your recipes to reference data extracted through this connection. You can’t change the developer name after you create the connection. |
| Description | Description |
| Schema | Name of the Google BigQuery Dataset ID you’re connecting to. |
| Private Key | Enter the Don’t include |
| Client Email | Enter the client_email value from the JSON
file. |
| Project ID | Enter the If you have multiple projects with the same service account, enter the ID of the project containing the dataset that you want to connect to. |
| Billing Project ID | The ID for the Cloud Billing account you want this connection’s activity charged to. |
| Extract Mode | Optional setting. Enter one of the following modes to extract data from Google BigQuery. Direct is the default if a mode isn’t specified. Direct: Use this mode to extract small data volumes. The connector extracts the data directly from Google BigQuery. Staging: Use this mode to extract large data volumes, such as 10 million records. To increase performance when handling large data volumes, the connector stages the data in the specified Google Cloud storage path and then extracts the data from the storage path. If a direct extract fails, try using this extract mode. |
| Use Storage API | Optional setting. True: Uses the Google BigQuery Storage Read API. See Google’s BigQuery Storage Read API documentation to understand your expected consumption, and Google’s data extraction pricing for additional cost information. False: Uses the Direct extract mode. This mode has a data limit of 10MB. |
Filter Data Synced to CRM Analytics
Exclude unnecessary or sensitive data from syncing to CRM Analytics with data sync filters. Filters run on the source object and speed up data sync by pulling only the data you need into CRM Analytics.
- From Data Manager, click the Connections tab.
- Select the connection associated with the object to filter.
- Click the name of the object to filter.
- Click Data Sync Filter.
- Enter the filter.
- Click Save.
For the Google BigQuery connector, enter a filter in the syntax described in Google’s BigQuery Help.
Google BigQuery Connector Considerations
Keep these behaviors in mind when working with the Google BigQuery connector.
- Connected object names must start with a letter and contain only letters, digits, or underscores. Object names can’t end with an underscore.
- Only field names with combinations of alphanumeric, dot, underscore, or dash characters are supported. If a connector includes field names that contain other characters, such as spaces or brackets, the sync fails.
- The connector can sync up to 100 million rows or 50 GB per object, whichever limit is reached first.
- BigQuery tables using data integrated from Google Drive aren’t supported. The Google Drive data must be moved into BigQuery.
- Nested and Repeated Fields
- The connector flattens nested fields and syncs them as separate fields. In addition,
the connector generates new rows for repeated fields. Let’s look at an example. The
contact data in this JSON file contains the current and previous address for each
contact. The addresses field has nested
status, street,
city, and state fields.
These nested fields appear twice for each contact: first for the current address, and
then for the previous
address.
{"id":"1","name":"James Park","addresses":[{"status":"current","street":"1 Harper Alley","city":"Toledo","state":"OH"},{"status":"previous","street":"392 Parkside Street","city":"Seattle","state":"WA"}]} {"id":"2","name":"Lori Carr","addresses":[{"status":"current","street":"7501 Talisman Court","city":"Fort Worth","state":"TX"},{"status":"previous","street":"3368 Anderson Lane","city":"Moreno Valley","state":"CA"}]}If you include the addresses field for sync, each nested field appears as a separate field in each row of the synced connected object. The repeated address fields result in two rows for each contact: one row for the current address, and one row for the previous address.
id name addresses.status addresses.street addresses.city addresses.state 1 James Park current 1 Harper Alley Toledo OH 1 James Park previous 392 Parkside Street Seattle WA 2 Lori Carr current 7501 Talisman Court Fort Worth TX 2 Lori Carr previous 3368 Anderson Lane Moreno Valley CA - Temporary Destination Tables
- The connector creates temporary destination tables in BigQuery to stage data before serving it to the client. The connector names these tables in the format EA_TEMP_<5-character random string>_<objectName>. Tables are usually deleted automatically. To avoid incurring extra data storage costs on Google BigQuery, check that all temporary tables have been deleted, and manually delete any tables that haven’t been deleted.
- Table Support
- The Google BigQuery for Legacy SQL connector supports Standard SQL Tables, Legacy SQL Tables, and Legacy SQL Views, but doesn’t support Standard SQL Views.
| Setting | Description |
|---|---|
| Storage Path | Applicable only to the legacy connector version. Required when using the Staging extract mode. Path in Google Cloud Storage where a local stage file is created to store the data temporarily. Enter the bucket name or the bucket name and folder name. For example, enter <bucket_name> or <bucket_name>/<folder_name>. To write files to this staging area, the user specified in Client Email must have the list, read, and write permissions on the bucket. |

