tSnowflakeBulkExec
Loads data from files in a folder into a Snowflake table. The folder
can be in an internal Snowflake stage, an Amazon Simple Storage Service (Amazon S3) bucket,
or an Azure container.
tSnowflakeBulkExec components work together in a two-step process:
- The tSnowflakeOutputBulk component uploads incoming data to a
storage. - The tSnowflakeBulkExec component loads the data from a storage into a
Snowflake database table.
You can transform the data before it is loaded into the database table in this two-step
process. These two steps are fused together in the tSnowflakeOutputBulkExec component, detailed in a separate section.
tSnowflakeBulkExec Standard properties
These properties are used to configure tSnowflakeBulkExec running in the Standard
Job framework.
The Standard
tSnowflakeBulkExec component belongs to the Cloud family.
The component in this framework is available in all subscription-based Talend products.
connector. The properties related to database settings vary depending on your database
type selection. For more information about dynamic database connectors, see Dynamic database components.
Basic settings
Database |
Select a type of database from the list and click |
Property |
Select the way
This property is available when Use this Component is selected from the |
Connection Component |
Select the component that opens the database connection to be reused by this |
Account |
In the Account field, enter, in double quotation marks, the account name This field is available only when |
Snowflake Region |
Select an AWS region or an Azure region from This field is available only when |
User Id and Password |
Enter, in double quotation marks, your authentication
This field is available only when |
Warehouse |
Enter, in double quotation marks, the name of the This field is available only when |
Schema |
Enter, within double quotation marks, the name of the This field is available only when |
Database |
Enter, in double quotation marks, the name of the This field is available only when |
Table |
Click the […] button and in the displayed wizard, select the Snowflake To load the data into a new table, select |
Schema and Edit Schema |
A schema is a row description. It defines the number of fields Built-In: You create and store the schema locally for this component Repository: You have already created the schema and stored it in the If the Snowflake data type to Click Edit
Note that if the input value of any non-nullable primitive This This |
Table Action |
Select the action to be carried out to the table.
|
Output Action |
Select the operation you want to perform to the incoming
|
Storage | Select the type of storage from which the data will be loaded to the table.
|
Stage Folder |
Specify the Snowflake stage folder to load data from.
This field is available when you |
Region | Specify the region where the S3 bucket locates.
This field is available when you select |
Access Key and Secret Key |
Enter the authentication information required to connect to the Amazon S3 bucket to be used. To enter the password, click This field is available when you select |
Bucket | Enter the name of the bucket to be used to load data. This bucket must already exist. This field is available when you select |
Folder | Enter the folder (in double quotation marks) from which you want to load data. This field is available when S3 or Azure is selected |
Protocol | Select the protocol used to create Azure connection.
This field is available when you select |
Account Name |
Enter the name (in double quotation marks) of the Azure storage account you need to access. This field is available when you select |
Container | Specify the Azure container (in double quotation marks) used for storing and managing data. This field is available when you select |
SAS Token | Specify the SAS token to grant limited access to objects in your storage account. To enter the SAS token, click the This field is available when you select |
Advanced settings
Additional JDBC Parameters |
Specify additional connection properties for the database connection you are This field is available only when you |
Use Custom Snowflake Region |
Select this check box to specify a custom
Snowflake region. This option is available only when you select Use This Component from the Connection Component drop-down list in the Basic settings view.
For more information on Snowflake Region |
Login Timeout |
Specify the timeout period (in minutes) |
Role |
Enter, in double quotation marks, the default access This role must already exist and has been granted to the |
Allow Snowflake to convert columns and tables to uppercase |
Select this check box to convert lowercase in the defined If you deselect the check box, all identifiers are This property is not available when you select the For more information on the Snowflake Identifier Syntax, |
Temporary Table Schema |
Specifies a schema for the temporary table.
The schema must exist. |
Custom DB Type |
Select this check box to specify the DB type for each column in the schema. This property is available only when you |
Delete Storage Files On Success |
Delete all the files in the storage folder once the data is loaded to the table successfully. This field is |
S3 Max Error Retry |
Specify the maximum data loading This field is available when you select |
Azure Max Error Retry |
Specify the maximum data loading This field is available when you select |
Use Custom S3 Connection Configuration |
Select this check box if you wish to use your custom S3 configuration. Option: select the parameter from the list. Value: enter This field is available when you select |
Use Custom Stage Prefix |
Select this check box to specify This field is available when you Once selected, the Stage |
Use Custom Storage Location |
Select this check box to connect to a custom external storage, for example, S3. |
Copy Command Options | Set parameters for the COPY INTO command by selecting the following options from the drop-down list. The COPY INTO command is provided by Snowflake. It loads data to a Snowflake database table.
For information about the parameters of the COPY INTO command, see |
tStatCatcher Statistics |
Select this check box to gather the Job processing metadata at the Job level |
Global Variables
NB_LINE |
The number of rows processed. This is an After variable and it returns an integer. |
NB_SUCCESS |
The number of rows successfully processed. This is an After variable and it returns an |
NB_REJECT |
The number of rows rejected. This is an After variable and it returns an integer. |
ERROR_MESSAGE |
The error message generated by the component when an error occurs. This is an After |
Usage
Usage rule |
This component is an end component of a data flow in your Job. |
Loading data in a Snowflake table using custom stage path
Snowflake stage configured using the Custom Stage Path property.
The input data contains several records.
1 2 3 4 |
#Name Bill Franklin Jimmy |
Then, the input data is inserted into a Snowflake table and the path to the internal
Snowflake stage is customized in the Advanced settings of
tSnowflakeOutputBulk and
tSnowflakeBulkExec.
Finally, the input data is outputted from the tSnowflake table to the console.
Creating a Job for loading data using custom stage path
Create a Job to open a connection to access a Snowflake database, then create a
Snowflake table and several records and insert these records into the table via the
internal Snowflake stage configured using the Custom Stage Path property, and finally get
and display the records on the console.
-
Create a new Job and add a tSnowflakeConnection component, a
tFixedFlowInput component, a
tSnowflakeOutputBulk component, a
tSnowflakeBulkExec component, a
tSnowflakeInput component, a
tSnowflakeClose component, and two
tLogRow components by typing their names in the design
workspace or dropping them from the Palette. -
Link the tFixedFlowInput component to the first
tLogRow component using a Row >
Main connection. -
Do the same to link the first tLogRow component to the
tSnowflakeBulkExec component and link the
tSnowflakeInput component to the second
tLogRow component. -
Link the tSnowflakeConnection component to the
tFixedFlowInput component using a
Trigger > OnSubjobOk
connection. -
Do the same to link the tFixedFlowInput component to the
tSnowflakeInput component and the
tSnowflakeInput component to the
tSnowflakeClose component. -
Link the tSnowflakeOutputBulk component to the
tSnowflakeBulkExec component using a
Trigger > OnComponentOk
connection.
Opening a connection to access a snowflake database
connection to access a Snowflake database.
-
Double-click the tSnowflakeConnection component to open its
Basic settings view. -
In the Account, User Id,
Password , Warehouse,
Schema and Database fields, specify
the authentication information required to access the Snowflake Database. -
Select an AWS region available for the Snowflake database from the
Snowflake Region drop-down list. In this example, it is
AWS US West.
Loading data to the Snowflake table
tSnowflakeBulkExec components to load data to the Snowflake
table.
-
Double-click the tFixedFlowInput component to open its
Basic settings view. -
Click the button next to Edit schema to
define the schema. In this example, the schema has only one column: Name. -
In the Mode area, select Use Inline
Table. Then add three records. In this example, they are:1234BillFranklinJimmy -
Double-click the first tLogRow component to open its
Basic settings view. -
In the Mode area, select Table to
display data. -
Double-click the tSnowflakeOutputBulk component to open
its Basic settings view. -
Specify the connection details required to access Snowflake. In this example,
from the Connection Component drop-down list displayed,
select the connection component to reuse its connection details you have already
defined. -
If needed, click the Sync columns button to make sure
the schema is properly retrieved from the preceding component. -
Select Internal from the Storage
drop-down list and enter demo within double quotes in the
Stage Folder field. -
Double-click the tSnowflakeBulkExec component to open
its Basic settings view. -
Specify the connection details required to access Snowflake. In this example,
from the Connection Component drop-down list displayed,
select the connection component to reuse its connection details you have already
defined. -
Click the button next to the Table field
to select the table you want to load data. In this example, it is
DEMO_NAMES. -
If needed, click the Sync columns button to make sure
the schema is properly retrieved from the preceding component. -
Select INSERT from the Output
Action drop-down list to insert data to the table
DEMO_NAMES. -
Select Internal from the Storage
drop-down list and enter demo in the Stage
Folder field.
Using custom stage path to load data
tSnowflakeOutputBulk and
tSnowflakeBulkExec components to use the Custom Stage Path
property to load data.
-
Click Advanced settings of the
tSnowflakeOutputBulk component to open its
Advanced settings view. -
Select the Use Custom Stage Path check box and enter
@~/demo within double quotes. As a result, the
Stage Folder you specified in the Basic
settings is disabled. -
Select Default from the Put Command
Options drop-down list. -
Set Put Command Error Retry to
3. -
Clear the Stop on non-empty Storage Folder check
box. -
Click Advanced settings of the
tSnowflakeBulkExec component to open its
Advanced settings view. -
Select the Convert columns and table to uppercase check
box to convert the columns to uppercase. -
Select Use Custom Stage Path and enter
@~/demo within double quotes. As a result, the
Stage Folder you specified in the Basic
settings is disabled. - Clear the Use Custom Storage Location check box.
-
Select Manual from the Copy Command
Options drop-down list and enter ON_ERROR='continue'
FILE_FORMAT=(type=csv field_delimiter=',' compression=gzip
field_optionally_enclosed_by='"') within double quotes.
Retrieving data from the Snowflake table
the Snowflake table, and then configure the second tLogRow
component to get and display data on the console.
-
Double-click the tSnowflakeInput component to open its
Basic settings view. -
Specify the connection details required to access Snowflake. In this example,
from the Connection Component drop-down list displayed,
select the connection component to reuse its connection details you have already
defined. -
Click the button next to the Table field
to select the table you want to retrieve data. In this example, it is
DEMO_NAMES. -
Click the button next to Edit schema to
open the schema dialog box and define the schema. In this example, the schema
has only one column: Name. -
Click Advanced settings to open the Advanced
settings view. -
Select the Convert columns and table to uppercase check
box to convert the columns to uppercase. -
Double-click the second tLogRow component to open its
Basic settings view. -
In the Mode area, select Table to
display data.
Executing the Job
then F6 to execute the Job.
the console.
Related scenarios
For use cases in relation with tSnowflakeBulkExec, see the following
scenarios: