TPT Load
Overview
The TPT Load Snap uses the tbuild command installed in the Operating System to load data into empty tables.
Teradata tbuild program should be installed on the Snaplex where the Snap is being executed. The Snap generates a script based on the field mapping which is executed using the tbuild program. The Snap also captures the output generated from the tbuild program and writes to the OUT field in the output document.
- This is a Write-type Snap.
Does not support Ultra Tasks
Prerequisites
TPT Snaps (TPT Insert, TPT Update, TPT Delete, TPT Upsert, and TPT Load) use the tbuild utility for the respective operations.
- The respective TPT utilities must be installed/available on the Snaplexes.
- All the required TPT utilities must be installed on the node where JCC is running or the Snap simply executes but may not perform the operation.
- Any utility/library file missing on the node may cause the Snap to perform a failed operation.
Basic steps for installing the TPT utilities:
- Download the Teradata Tools and Utilities base such as
TTU 16.20.25.00 Linux - Basefor Linux environment. - If the OS is 64 bit, install 32 bit support packages on the environment and also any further dependencies.
- Install the Teradata Tools and Utilities (that includes tbuild, fastload, mload etc).
- The default installation also configures the PATH in the OS.
If tbuild or fastload is already available in the OS path then the corresponding TPT Snap can call the utility. However, if these binaries are not available in the OS path, then you need to provide the absolute path of the respective binary in the Snap.
Limitations
- To support UTF-8 in TPT Load Snap:
- Enter the
CHARSET=UTF8under URL properties in Teradata account. - Create the text-type columns in the target table as UNICODE. For example,
CREATE TABLE <target table name> (field2 VARCHAR(100) CHARACTER SET UNICODE).
- Enter the
- The TBUILD utility used by TPT Load Snap limits the size of the text-type columns to 32,000 bytes. For example, for LONG VARCHAR column, the input values should be less than or equal to 32,000 bytes. If this limit is exceeded, TBUILD throws an exception and TPT Load Snap writes the error to the error view.
- If input strings have single-byte special characters from 0x90 to 0xFF, those characters are counted as two bytes each.
Snap views
| Type | Description | Examples of upstream and downstream Snaps |
|---|---|---|
| Input |
This Snap has two input views but by default it has one input view. You can add a second view for metadata for the table as a document so that the table is created with a similar schema as the source table. This schema is usually from the second output of a database Select Snap. If the schema is from a different database, the data types might not be properly handled. Expected input: A stream of documents to be loaded into the table. Each input document contains values for one record in the table. |
|
| Output |
This Snap has one output view. The output view produces three output fields: Script, Status, and Out.
Expected output: A single document containing the console output, return status from tbuild, and the script which the Snap submitted to tbuild. |
|
| Learn more about Error handling. | ||
Snap settings
- Expression icon (
): Allows using pipeline parameters to set field values dynamically (if enabled). SnapLogic Expressions are not supported. If disabled, you can provide a static value.
- SnapGPT (
): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
- Suggestion icon (
): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
- Upload
: Uploads files. Learn more.
| Field/Field set | Description |
|---|---|
Label
String |
Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline. Default value: TPT Load |
Schema name
String/Expression/ Suggestion |
Specify the database schema name. If not defined, the suggestion for the table name will retrieve all the table names of all the schemas. The property is suggestible and will retrieve available database schemas during suggest values.
The values can be passed using the pipeline parameters but not the upstream parameter. Default value: N/A Example: SYS |
Table name*
String/Expression/ Suggestion |
Required. Specify the name of the table to insert records into.
The values can be passed using the pipeline parameters but not the upstream parameter. Default value: N/A Example: people |
Create table if not present
Checkbox |
Select this checkbox to automatically create the target table if it does not exist.
If a second input view is configured for the Snap and it contains a document with schema (metadata) from the source table, the Snap creates the new (target) table using the same schema (metadata). However, if the schema comes from a different database, the Snap might fail with the Unable to create table: "<table_name>" error due to data type incompatibility. In the absence of a second input view, the Snap creates a table based on the data types of the columns generated from the first row of the input document (first input view). Note: Due to implementation details, a newly created table is not visible to subsequent database Snaps during runtime validation. If you want to immediately use the newly updated data you must use a child Pipeline that is invoked through a Pipeline Execute Snap.
Default value: Deselected |
TBUILD location
String/Expression |
Specify the absolute path for fastload command. If this field is left blank then the Snap tries to load the fastload command from the Operating System.
Default value: N/A Example: /usr/bin/fastload.exe |
Write error table records to error view
Checkbox |
Select this check box to write all the records from the error tables to an error view after a fast load execution.
Default value: Deselected |
Fetch metadata delay (seconds)
Integer/Expression |
Specify the wait time in seconds to be used before fetching metadata to avoid conflicts while performing Teradata parallel executions in a pipeline.
Default value: 0 Example: 5 |
Delete table data if present
Checkbox |
Select this check box to delete the table data if present.
If selected, the data will be deleted from the table before loading. If not selected, it displays an error to ensure the table is empty and not locked. Default value: Deselected |
Query band
String/Expression |
Specify the name-value pairs to use in the session's generated query band statement. The query band is passed to the Teradata database as a list of name-value pairs separated by semi-colons.
Default value: N/A Example: ProjectName=dstage1;user=test; |
Snap execution
Dropdown list |
Choose one of the three modes in
which the Snap executes. Available options are:
|
Troubleshooting
| Error | Cause | Resolution |
|---|---|---|
| Failure: TPT script failed to execute error code: 8 |
The Snap is unable to read the TPT Load absolute path. | Leave the field blank or update the absolute path with .exe extension to prevent your pipeline from failing.
For example, if you used |
| Failure: Failed to execute query error code: 5992 |
A syntax error was found in the QUERY_BAND. | Check that the query band is in the form specified in the Query band field above.
For example, if you used |