# tBigQueryBulkExec

Transfers given data to Google BigQuery.

The tBigQueryOutputBulk and tBigQueryBulkExec components are generally used together as parts of a two step process. In the first step, an output file is generated. In the second step, this file is used to feed a dataset. These two steps are fused together in the tBigQueryOutput component, detailed in a separate section. The advantage of using two separate components is that the data can be transformed before it is loaded in the dataset.

This component transfers a given file from Google Cloud Storage to Google BigQuery, or uploads a given file into Google Cloud Storage and then transfers it to Google BigQuery.

## tBigQueryBulkExec Standard properties

These properties are used to configure tBigQueryBulkExec running in the Standard Job framework.

The Standard tBigQueryBulkExec component belongs to the Big Data family.

The component in this framework is available in all Talend products.

## Basic settings

| Properties | Description |
| --- | --- |
| Schema and Edit schema | A schema is a row description. It defines the number of fields<br>(columns) to be processed and passed on to the next component. When you create a Spark<br>Job, avoid the reserved word line when naming the<br>fields.<br><br><ul> <li> <p> <span>Built-In</span>: You create and store the schema locally for this component                only.</p> </li> <li> <p> <span>Repository</span>: You have already created the schema and stored it in the                Repository. You can reuse it in various projects and Job designs.</p> </li> </ul><br><br>Click Edit schema to make changes to<br>the schema. If you make changes, the schema automatically becomes built-in.<br><br><ul> <li> <p> <span>View schema</span>: choose this                option to view the schema only.</p> </li> <li> <p> <span>Change to built-in property</span>:                choose this option to change the schema to <span>Built-in</span> for local changes.</p> </li> <li> <p> <span>Update repository connection</span>:                choose this option to change the schema stored in the repository and decide whether                to propagate the changes to all the Jobs upon completion.</p> <p>If you just want to                propagate the changes to the current Job, you can select <span>No</span> upon completion and choose this schema metadata                again in the <span>Repository Content</span>                window.</p> </li> </ul> |
| Authentication mode | Select the mode to be used to authenticate to your project.<br><br><ul> <li><span>Service account</span>: authenticate using a Google account                        that is associated with your Google Cloud Platform project. When selecting                        this mode, the credentials must be provided in the <span>Service                           account credentials file</span> field.</li> <li><span>Workload Identity Federation</span>: authenticate                        through a Google Workload Identity Pool, allowing integration with identity providers such as                        AWS, Azure, or OIDC, without needing a service account key. When selecting                        this mode, the identity federation configuration must be provided in the                           <span>Client library configuration file</span> field.</li> <li><span>Application Default Credentials</span>: authenticate using                        the Application Default Credentials. When selecting this mode, no additional                        parameters need to be defined as credentials are automatically found based                        on the application environment.</li> <li> <span>OAuth 2.0 - Authorization Code grant</span>: authenticate                        using OAuth credentials. The OAuth parameters must be provided in the                           <span>Client ID</span>, <span>Client secret</span>,                           <span>Authorization code</span>, and <span>Redirect                           URI</span> fields. Only Desktop application credentials are                        supported. For more information, read <a href="https://support.google.com/googleapi/answer/6158849#zippy=%2Cnative-applications%2Cdesktop-apps" target="_blank">Desktop apps</a> and <a href="https://help.qlik.com/talend/en-US/components/8.0/google-bigquery/accessing-bigquery-using-oauth-2-0-authentication-mode" title="Use OAuth 2.0 - Authorization Code grant to connect BigQuery components to Google BigQuery in a Standard Job.">Accessing BigQuery using OAuth 2.0 authentication mode</a>.</li> <li> <span>OAuth Access Token</span>: authenticate using an OAuth                        access token. When selecting this mode, the token must be provided in the                           <span>OAuth Access Token</span> file. </li> </ul><br><br>To know more about the Google Cloud authentication process, read [the Google Cloud documentation](https://cloud.google.com/docs/authentication/). |
| Service account credentials file | Enter the path to the credentials file created for the service account to be<br>used. This file must be stored in the machine in which your Talend<br>Job is actually launched and executed.<br><br>This property is only available when you<br>authenticate using Service account. |
| Client ID and Client secret | Paste the client ID and the client secret, both created and viewable<br>on the API Access tab view of the project hosting the Google BigQuery service and<br>the Cloud Storage service you need to use.<br><br>To enter the client secret, click the [...]<br>button next to the client secret field, and then in the pop-up dialog box enter the client<br>secret between double quotes and click OK to save the<br>settings.<br><br>This property is only available when you authenticate using OAuth<br>2.0 - Authorization Code grant. |
| OAuth Access Token | Enter an access token.<br><br>The lifetime of the token is one hour. The<br>component does not perform the token refresh operation but will fetch the new<br>access token to operate beyond the one-hour limit.<br><br>This property is only<br>available when you authenticate using OAuth Access<br>Token. |
| Redirect URI | Enter the redirect URI for your Google OAuth desktop application.<br><br>Use a loopback URI such as http://127.0.0.1:&lt;port&gt; or http://localhost:&lt;port&gt;.<br><br>This value must exactly match one of the redirect URIs configured in your Google OAuth client.<br><br>For more information, see [redirect_uri parameter](https://developers.google.com/identity/protocols/oauth2/native-app#request-parameter-redirect_uri) and [loopback IP address](https://developers.google.com/identity/protocols/oauth2/native-app#redirect-uri_loopback) in Google documentation.<br><br>This property is only available when you authenticate using OAuth<br>2.0 - Authorization Code grant. |
| Authorization code | Paste the authorization code provided by Google for the access you are<br>building.<br><br>To obtain the authorization code, you need to execute the Job using this<br>component and when this Job pauses execution to print out an URL address, you navigate<br>to this address to copy the authorization code displayed. For more information, read<br>[Accessing BigQuery using OAuth 2.0 authentication mode](https://help.qlik.com/talend/en-US/components/8.0/google-bigquery/accessing-bigquery-using-oauth-2-0-authentication-mode "Use OAuth 2.0 - Authorization Code grant to connect BigQuery components to Google BigQuery in a Standard Job.").<br><br>This property is only available when you authenticate using OAuth<br>2.0 - Authorization Code grant. |
| Project ID | Paste<br>the ID of the project hosting the Google BigQuery service you need to<br>use.<br><br>The ID of your project can be<br>found in the URL of the Google API Console, or by hovering your mouse<br>pointer over the name of the project in the BigQuery Browser<br>Tool. |
| Dataset | Enter the name of the dataset you need to transfer data to. |
| Table | Enter the name of the table you need to transfer data to.<br><br>If<br>this table does not exist, select the Create the table<br>if it doesn't exist checkbox. |
| Action on data | Select the action to be performed from the dropdown list when transferring<br>data to the target table. The action may be:<br><br><ul> <li> <p> <span>Truncate</span>: it empties the contents of                           the table and repopulates it with the transferred data. </p> </li> <li> <p> <span>Append</span>: it adds rows to the existing                           data in the table. </p> </li> <li> <p> <span>Empty</span>: it populates the empty table.                        </p> </li> </ul> |
| Credential type | Select the type to be used to authenticate to your project.<br><br><ul> <li><span>Service account</span>: when selecting this credential type,                     the parameter to be defined in the <span>Basic settings</span> view                     is <span>Service account key</span>.</li> <li><span>Application Default Credentials</span>: when selecting this                     credential type, the parameter to be defined in the <span>Basic                        settings</span> view is <span>Application Default                        Credentials</span>.</li> <li><span>OAuth Access Token</span>: when selecting this credential                     type, the parameter to be defined in the <span>Basic settings</span>                     view is <span>OAuth Access Token</span>.</li> </ul><br><br>By default, Service account is selected. The<br>Credential type field is available only if you do not<br>select the Bulk file already exists in Google storage check<br>box. |
| Bulk file already exists in Google<br>storage | Select this checkbox to reuse the authentication information for Google Cloud<br>Storage connection, then, complete the File and the<br>Header fields. |
| Service account key | Click the [...] button next to the<br>service account key field to browse for the JSON file that contains your service<br>account key.<br><br>This property is only available when you authenticate using<br>Service account. |
| Access key and Secret key | Paste the authentication information obtained from Google for<br>making requests to Google Cloud Storage.<br><br>To enter the secret key, click the [...]<br>button next to the secret key field, and then in the pop-up dialog box enter the password<br>between double quotes and click OK to save the<br>settings.<br><br>These<br>keys can be consulted on the Interoperable Access tab view under the Google Cloud<br>Storage tab of the project. |
| OAuth Access Token | Enter an access token.<br><br>The lifetime of the token is one hour. The component<br>does not perform the token refresh operation but will fetch the new access token<br>to operate beyond the one-hour limit.<br><br><br>This property is only available when you<br>authenticate using OAuth Access Token. |
| File to upload | When the data to be<br>transferred to Google BigQuery is not stored on Google Cloud Storage, browse to, or<br>enter the path to it. |
| Bucket | Enter the name of the bucket, the Google Cloud Storage container, which<br>holds the data to be transferred to Google BigQuery. |
| File | Enter the directory of the data stored on Google Cloud Storage and<br>to be transferred to Google BigQuery.<br><br>If the data is not on Google Cloud Storage,<br>this directory is used as the intermediate destination before the data<br>is transferred to Google BigQuery. |
| Header | Set values to ignore the header of the transferred data. For example, enter<br>*0* to ignore no rows for the data without header. |
| Die on error | This checkbox is cleared by default, meaning to skip the row on error and to<br>complete the process for error-free rows. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Use a custom endpoint | Select this check box to use a private endpoint rather than the default one.<br><br>When selected, enter the URL in the following properties:<br><br><ul> <li><span>Google Storage Private API URL</span> by respecting the                           <span>"https://storage.googleapis.com"</span> format.</li> <li><span>Google BigQuery Private API URL</span> by respecting the                           <span>"https://bigquery.googleapis.com"</span> format.</li> </ul><br><br>For more information, see [Access Google APIs through endpoints](https://cloud.google.com/vpc/docs/configure-private-service-connect-apis) in<br>the Google Cloud documentation.<br><br>This property is only available when you<br>authenticate using Service account and<br>Application Default Credentials. |
| *token<br>properties File Name* | Enter the path to, or<br>browse to the refresh token file you need to use.<br><br>At the first Job execution using the Authorization code you have obtained from Google BigQuery, the<br>value in this field is the directory and the name of that refresh token file to be<br>created and used; if that token file has been created and you need to reuse it, you<br>have to specify its directory and file name in this field.<br><br>With only the token file name entered, Talend Studio considers the directory of that token file to be the root of the<br>Talend Studio folder.<br><br>For further information<br>about the refresh token, see the manual of Google BigQuery. |
| Set the field delimiter | Enter a character, a string, or a regular expression to separate<br>fields for the transferred data. |
| Use custom null marker | Select this option to use a specific character as the<br>null marker. You can specify the null marker in double quotation markers<br>in the text frame to the right.<br><br>This option<br>prevents errors caused by fields with null values. |
| Drop table if exists | Select the Drop table if exists checkbox to remove the table specified in the Table field, if this table already exists. |
| Encoding | Select the encoding from the list or select Custom<br>and define it manually. This field is compulsory for database data handling. The<br>supported encodings depend on the JVM that you are using. For more information, see<br>[https://docs.oracle.com](https://docs.oracle.com/). |
| tStatCatcher Statistics | Select this checkbox to collect the log data at the component<br>level. |

## Global Variables

| Variables | Description |
| --- | --- |
| ERROR\_MESSAGE | The error message generated by the component when an error<br>occurs. This is an After variable and it returns a string. This variable<br>functions only if the Die on error<br>check box is selected. |
| JOBID | The ID of the Job. This is an After variable and it returns<br>a string. |
| STATISTICS | The statistics of the Job. This is an After variable and it<br>returns a string. |

## Usage

| Usage guidance | Description |
| --- | --- |
| Usage rules | This is a standalone component.<br><br>This component automatically detects and supports both<br>multi-regional locations and regional locations. When using the regional locations,<br>the buckets and the datasets to be used must be in the same locations. |
| BigQuery data type limitations | <ul> <li>The Record type of BigQuery is not supported.</li> <li>The columns for table metadata such as the                                Description column or the Mode column cannot be retrieved.</li> <li>The Timestamp data from your BigQuery system is formatted to be String                        data.</li> <li>The numeric data of BigQuery is converted to                                BigDecimal.</li> </ul> |