# tRedshiftOutputBulkExec

Executes the Insert action on the data provided.

As a dedicated component, it allows gains in performance during Insert operations to Amazon Redshift.

The tRedshiftOutputBulk and tRedshiftBulkExec components can be used together in a two step process to load data to Amazon Redshift from a delimited/CSV file on Amazon S3. In the first step, a delimited/CSV file is generated. In the second step, this file is used in the INSERT statement used to feed Amazon Redshift. These two steps are fused together in the tRedshiftOutputBulkExec component. The advantage of using two separate steps is that the data can be transformed before it is loaded to Amazon Redshift.

This component receives data from the preceding component, generates a single delimited/CSV file and uploads the file to Amazon S3, finally it loads the data from Amazon S3 to Redshift.

## tRedshiftOutputBulkExec Standard properties

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

The Standard tRedshiftOutputBulkExec component belongs to the Cloud and the Databases families.

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

Information noteNote: This component is a specific version of a dynamic database connector. The properties related to database settings vary depending on your database type selection. For more information about dynamic database connectors, see [DB Generic components](https://help.qlik.com/talend/r/en-US/8.0/components/db-generic/db-generic-component).

## Basic settings

| Properties | Description |
| --- | --- |
| Database | Select the desired database type from the list and click<br>Apply. |
| Property Type | Either Built-In or<br>Repository.<br><br><ul> <li> <span>Built-In</span>: No property data stored                                centrally.</li> <li> <span>Repository</span>: Select the repository                                file in which the properties are stored. The database connection fields                                that follow are completed automatically using the data retrieved.</li> </ul> |
| Use an existing connection | Select this check box and in the Component<br>List drop-down list, select the desired connection component to<br>reuse the connection details you already defined. |
| Driver version | Select the Redshift driver version to be used: Driver v1 or<br>Driver v2.<br><br>Information noteNote: This option is available only when you have installed the 8.0.1-R2022-04<br>Talend Studio<br>Monthly update or a later one delivered by Talend. For more information, check with your administrator. |
| Host | Type in the IP address or hostname of the database<br>server. |
| Port | Type in the listening port number of the database<br>server. |
| Database | Type in the name of the database. |
| Schema | Type in the name of the schema. |
| Username and Password | Type in the database user authentication data.<br><br>To enter the password, click the [...] button<br>next to the password field, enter the password in double quotes in the pop-up dialog box,<br>and click OK to save the settings. |
| Use String JDBC parameters | Set JDBC properties in a string. If you select this option, enter your JDBC parameter string in<br>the Additional JDBC Parameters field; otherwise, enter JDBC<br>properties and property values in the Additional JDBC<br>Parameters table.<br><br>This option is not available if Driver v1 is selected from<br>the Driver version drop-down list.<br><br>Information noteNote: This option is available only when you have installed the 8.0.1-R2022-04<br>Talend Studio<br>Monthly update or a later one delivered by Talend. For more information, check with your administrator. |
| Additional JDBC Parameters | Specify additional JDBC properties for the connection you are creating. The<br>properties are separated by ampersand & and each property is a key-value pair. For<br>example, *ssl=true &<br>sslfactory=com.amazon.redshift.ssl.NonValidatingFactory*, which means the<br>connection will be created using SSL.<br><br>This field is not available if Driver v2 is selected<br>from the Driver version drop-down list and the<br>Use String JDBC parameters option is not<br>selected. |
| Additional JDBC Parameters (table) | Specify JDBC properties in table rows.<br><br>To specify a JDBC property, add a row in the table by clicking the plus button on<br>the bottom of this table, enter the property name in the<br>Key column, and then enter the property value in the<br>Value column.<br><br>This table is available when Driver v2 is selected from the<br>Driver version drop-down list and the Use<br>String JDBC parameters option is not selected.<br><br>Information noteNote: This option is available only when you have installed the 8.0.1-R2022-04<br>Talend Studio<br>Monthly update or a later one delivered by Talend. For more information, check with your administrator. |
| Table Name | Specify the name of the table to be written. Note that<br>only one table can be written at a time. |
| Action on table | On the table defined, you can perform one of the<br>following operations:<br><br><ul> <li> <p> <span>None</span>: No operation is                                    carried out.</p> </li> <li> <p> <span>Drop and create table</span>:                                    The table is removed and created again.</p> </li> <li> <p> <span>Create table</span>: The table                                    does not exist and gets created.</p> </li> <li> <p> <span>Create table if not                                        exists</span>: The table is created if it does not                                    exist.</p> </li> <li> <p> <span>Drop table if exists and                                        create</span>: The table is removed if it already                                    exists and created again.</p> </li> <li> <p> <span>Clear table</span>: The table                                    content is deleted. You have the possibility to rollback the                                    operation.</p> </li> </ul> |
| 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><br>Built-In: You create and store the schema locally for this component<br>only.<br><br><br>Repository: You have already created the schema and stored it in the<br>Repository. You can reuse it in various projects and Job designs.<br><br>Click Edit<br>schema to make changes to the schema. If the current schema is of the Repository type, three options are available:<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> |
| Data file path at local | Specify the local path to the file to be generated.<br><br>Note that the file is generated on the same machine where<br>Talend Studio is installed or where the Job using this component is deployed. |
| Append the local file | Select this check box to append data to the specified<br>local file if it already exists, instead of overwriting it. |
| Create directory if not exists | Select this check box to create the directory specified<br>in the Data file path at local<br>field if it does not exist. By default, this check box is selected. |
| Use an existing S3 connection | Select this check box and in the Component<br>List drop-down list, select the desired connection component to<br>reuse the connection details you already defined.<br><br>Information noteNote: This component works with static credentials only. That is, it does not<br>inherit credentials from AWS role. The component will generate an error in Job<br>execution if any option other than Static Credentials is<br>selected from the Credential Provider drop-down list of<br>the tS3Connection component that creates the S3 connection. |
| Credential provider | Specify the way to obtain AWS security credentials: Static<br>credentials, which uses access key and<br>secret key as the AWS security credentials.<br><br>Information noteNote: This component works with static credentials only. That is, it does not<br>inherit credentials from AWS role. The component will generate an error in Job<br>execution if you select the Inherit credentials from AWS<br>role option. |
| Access Key | Specify the Access Key ID that uniquely identifies an AWS<br>Account. For how to get your Access Key and Access Secret, visit [Getting Your AWS Access<br>Keys](http://docs.aws.amazon.com/ses/latest/DeveloperGuide/get-aws-keys.html).<br><br>Information noteNote: This option is available when Use an existing S3<br>connection is not selected or Inherit credentials from AWS<br>role is not selected from the Credential provider<br>drop-down list. |
| Secret Key | Specify the Secret Access Key, constituting the security<br>credentials in combination with the access Key.<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>Information noteNote: This option is available when Use an existing S3<br>connection is not selected or Inherit credentials from AWS<br>role is not selected from the Credential provider<br>drop-down list. |
| S3 Assume Role | If you temporarily need some access permissions associated to an AWS IAM<br>role that is not granted to your user account, select this checkbox to assume that<br>role. Then specify the values for the following parameters to create a new assumed<br>role session.<br><br>Ensure that access to this<br>role has been granted to your user account by the trust policy associated to<br>this role. If you are not certain about this, ask the owner of this role or<br>your AWS administrator.<br><br>Information noteNote: This option is available<br>when Use an existing S3 connection is not<br>selected.<br><br><ul> <li><p><span>ARN</span>: the Amazon Resource Name (ARN) of the role to                           assume. You can find this ARN name on the <span>Summary</span>                           page of the role to be used on your AWS portal, for example, this role                           ARN could read like                              <kbd>am:aws:iam::[aws_account_number]:role/[role_name]</kbd>.                           </p><span>Role session name</span>: enter the                        name you want to use to uniquely identify your assumed role session. This                        name can contain upper- and lower-case alphanumeric characters with no                        spaces. You can also include underscores or any of the following characters:                        =,.@-. </li> <li> <p><span>Session duration                              (minutes)</span>: the duration (in minutes) for which you want                           the assumed role session to be active. This duration cannot exceed the                           maximum duration which your AWS administrator has set. The duration                           defaults to 3600 seconds if you give it no value. </p> </li> </ul><br><br><br>For an example about an IAM role and its related policy types, see [Create and Manage AWS IAM Roles](https://aws.amazon.com/blogs/security/now-create-and-manage-aws-iam-roles-more-easily-with-the-updated-iam-console/) from the AWS<br>documentation. |
| Region | Specify the AWS region by selecting or entering a region name between double<br>quotation marks (e.g. *"us-east-1"*). For more information about the<br>AWS Region, see [Regions and Endpoints](http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region).<br><br>Information noteNote: This field<br>is available when Use an existing S3 connection<br>is not selected. |
| Bucket | Type in the name of the Amazon S3 bucket, namely the top<br>level folder, to which the file is uploaded.<br><br>The bucket and the Redshift database to be used<br>must be in the same region on Amazon. This could avoid the S3ServiceException errors known to<br>Amazon. For further information about these errors, see [S3ServiceException Errors](https://docs.aws.amazon.com/redshift/latest/dg/s3serviceexception-error.html). |
| Key | Type in an object key to assign to the file uploaded to<br>Amazon S3. |
| Redshift Assume Role | Select this checkbox and specify the values for the<br>following parameters used to create a new assumed role session.<br><br><ul> <li> <p> <span>IAM Role ARNs chains</span>: a series of                                chained roles, which may belong to other accounts, that your cluster                                can assume to access resources. </p> <p>You can chain a maximum of 10 roles.</p> </li> <li> <p> <span>Role ARN</span>: the Amazon Resource Name                                (ARN) of the role to assume. </p> </li> </ul><br><br>For more information on IAM<br>Role ARNs chains, see [Authorizing Redshift service](https://docs.aws.amazon.com/redshift/latest/mgmt/authorizing-redshift-service.html). |

## Advanced settings

| Properties | Description |
| --- | --- |
| Fields terminated by | Enter the character used to separate<br>fields. |
| Enclosed by | Select the character in a pair of which<br>the fields are enclosed. |
| Compressed by | Select this check box and select a<br>compression type from the list displayed to compress the data file.<br><br>This field disappears when the<br>Append the local<br>file check box is selected. |
| Encrypt | Select this check box to generate and<br>upload the data file to Amazon S3 using client-side encryption. In the<br>Encryption<br>key field displayed, specify the encryption key used to<br>encrypt the file. Note that only a base64 encoded AES 128-bit or AES<br>256-bit envelope key is supported. For more information, see [Loading Encrypted<br>Data Files from Amazon S3](http://docs.aws.amazon.com/redshift/latest/dg/c_loading-encrypted-files.html).<br><br>By default, this check box is cleared<br>and the data file will be uploaded to Amazon S3 using server-side<br>encryption.<br><br>For more information about the<br>client-side and server-side encryption, see [Protecting Data<br>Using Encryption](http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingEncryption.html).<br><br>Information noteNote: This field is available when Use an existing S3 connection is not<br>selected. |
| Encoding | Select an encoding type for the data in<br>the file to be generated. |
| Delete local file after putting it to s3 | Select this check box to delete the<br>local file after being uploaded to Amazon S3. By default, this check box<br>is selected. |
| Date format | Select one of the following items from<br>the list to specify the date format in the source data:<br><br><ul> <li> <p> <span>NONE</span>: No date format is                                    specified.</p> </li> <li> <p> <span>PATTERN</span>: Select this item and                                    specify the date format in the field displayed. The default date                                    format is YYYY-MM-DD.</p> </li> <li> <p> <span>AUTO</span>: Select this item if you                                    want Amazon Redshift to recognize and convert automatically the                                    date format.</p> </li> </ul> |
| Time format | Select one of the following items from<br>the list to specify the time format in the source data:<br><br><ul> <li> <p> <span>NONE</span>: No time format is                                    specified.</p> </li> <li> <p> <span>PATTERN</span>: Select this item and                                    specify the time format in the field displayed. The default time                                    format is YYYY-MM-DD HH:MI:SS.</p> </li> <li> <p> <span>AUTO</span>: Select this item if you                                    want Amazon Redshift to recognize and convert automatically the                                    time format.</p> </li> <li> <p> <span>EPOCHSECS</span>: Select this item if                                    the source data is represented as epoch time, the number of                                    seconds since Jan 1, 1970 00:00:00 UTC.</p> </li> <li> <p> <span>EPOCHMILLISECS</span>: Select this                                    item if the source data is represented as epoch time, the number                                    of milliseconds since Jan 1, 1970 00:00:00 UTC.</p> </li> </ul> |
| Settings | Click the [+] button below the table to specify<br>more parameters for loading the data.<br><br><ul> <li> <p> <span>Parameter</span>: Click the cell and                                    select a parameter from the drop-down list.</p> </li> <li> <p> <span>Value</span>: Set the value for the                                    corresponding parameter. Note that you cannot set the value for                                    a parameter (such as <span>IGNOREBLANKLINES</span>) that does not                                    need a value.</p> </li> </ul><br><br>For more information about the<br>parameters, see http://docs.aws.amazon.com/redshift/latest/dg/r\_COPY.html. |
| Config client | Select this check box to configure<br>client parameters for Amazon S3. Click the [+] button below the table displayed to<br>add as many rows as needed, each row for a client parameter, and set the<br>following attributes for each parameter:<br><br><ul> <li> <p> <span>Client Parameter</span>: Click the                                    cell and select a parameter from the drop-down list.</p> </li> <li> <p> <span>Value</span>: Enter the value for the                                    corresponding client parameter.</p> </li> </ul><br><br>For information about S3 client parameters, go to [Client Configuration](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/section-client-configuration.html). |
| STS Endpoint | Select this check box to specify the AWS Security<br>Token Service (STS) endpoint from which to retrieve the session credentials.<br>For example, enter sts.amazonaws.com.<br><br>This check box is available only when the S3 Assume Role check box is<br>selected. |
| Signing<br>region | Select the AWS region of the STS service. If the region<br>is not in the list, you can enter its name between double quotation<br>marks. The default value is us-east-1.<br><br>This drop-down list is available only when the<br>S3 Assume Role check box is<br>selected. |
| External<br>Id | If the administrator of the account to which the role<br>belongs provided you with an external ID, enter its value here. The<br>External Id is a unique<br>identifier that allows a limited set of users to assume the role.<br><br>This field is available only when the S3 Assume Role check box is<br>selected. |
| Serial<br>number | When you assume a role, the trust policy of this role<br>might require Multi-Factor Authentication (MFA). In this case, you must<br>indicate the identification number of the hardware or virtual MFA device<br>that is associated with the user who assumes the role.<br><br>This field is available only when the S3 Assume Role check box is<br>selected. |
| Token<br>code | When you assume a role, the trust policy of this role<br>might require Multi-Factor Authentication (MFA). In this case, you must<br>indicate a token code. This token code is a time-based one-time password<br>produced by the MFA device.<br><br>This field is available only when the S3 Assume Role check box is<br>selected. |
| Tags | List session tags in the form of key-value pairs. You<br>can then use these session tags in policies to allow or deny access to<br>requests.<br><br><br>Transitive:<br>select this check box to indicate that a tag will persist to the next<br>role in a role chain.<br><br>For more information about tags, see [Passing Session Tags in AWS<br>STS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)<br><br>This field is available only when the S3 Assume Role check box is<br>selected. |
| IAM Policy<br>ARNs | Enter the Amazon Resource Names (ARNs) of the IAM<br>managed policies that you want to use as managed session policies. Use<br>managed session policies to limit the permissions of the session. The<br>policies must exist in the same account as the role. The resulting<br>session's permissions are the intersection of the role's identity-based<br>policy and the session policies.<br><br>For more information about session policies, see the<br>corresponding section in [Policies and<br>Permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)<br><br>This field is available only when the S3 Assume Role check box is<br>selected. |
| Policy | Enter an IAM policy in JSON format that you want to use<br>as a session policy. Use session policies to limit the permissions of<br>the session. The resulting session's permissions are the intersection of<br>the role's identity-based policy and the session policies.<br><br>For more information about session policies, see the<br>corresponding section in [Policies and<br>Permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)<br><br>This field is available only when the S3 Assume Role check box is<br>selected. |
| JDBC<br>url | Select a way to access to an Amazon Redshift database from the<br>JDBC url drop-down list.<br><br><ul> <li> <span>Standard</span>: Use the          standard way to access the Redshift database.</li> <li> <span>SSO</span>: Use the IAM          Single Sign-ON (SSO) authentication way to access the Redshift Database. Before selecting          this option, ensure that the IAM role added to your Redshift cluster has appropriate          access rights and permissions to this cluster. You can ask the administrator of your AWS          services for more details.<p>This option is available only when <span>Use an existing connection</span> check box is not selected from            the <span>Basic settings</span>. </p> </li> </ul> |
| tStatCatcher Statistics | Select this check box to gather the Job<br>processing metadata at the Job level as well as at each component<br>level. |

## Global Variables

| Variables | Description |
| --- | --- |
| Global Variables | ERROR\_MESSAGE: the error message generated by the<br>component when an error occurs. This is an After variable and it returns a string. This<br>variable functions only if the Die on error checkbox is<br>cleared, if the component has this checkbox.<br><br>A Flow variable functions during the execution of a component<br>while an After variable functions after the execution of the component.<br><br>To fill up a field or expression with a variable, press Ctrl+Space to access the variable list and choose the variable to use from<br>it.<br><br>For more information about variables, see [Using contexts and variables](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/contexts-and-variables). |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component is mainly used when no<br>particular transformation is required on the data to be loaded to Amazon<br>Redshift. |
| Dynamic settings | Click the [+] button to add a row in the table<br>and fill the Code field with a context<br>variable to choose your database connection dynamically from multiple<br>connections planned in your Job. This feature is useful when you need to<br>access database tables having the same data structure but in different<br>databases, especially when you are working in an environment where you<br>cannot change your Job settings, for example, when your Job has to be<br>deployed and executed independent of Talend Studio.<br><br>The Dynamic settings table is<br>available only when the Use an existing<br>connection check box is selected in the Basic settings view. Once a dynamic parameter is<br>defined, the Component List box in the<br>Basic settings view becomes unusable.<br><br>For examples on using dynamic parameters, see [Reading data from databases through<br>context-based dynamic connections](https://help.qlik.com/talend/r/en-US/8.0/components/defining-context-groups/reading-data-from-databases-through-context-based-dynamic-connections) and [Reading data from different MySQL databases<br>using dynamically loaded connection parameters](https://help.qlik.com/talend/r/en-US/8.0/components/context/reading-data-from-different-mysql-databases-using-dynamically-loaded-connection-parameters). For more information on<br>Dynamic settings and context variables, see<br>[Dynamic schema](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/dynamic-schema) and [Creating a context group and define context<br>variables in it](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/creating-context-group-and-define-context-variables-in-it). |