TPT Upsert

Overview

The TPT (Teradata Parallel Transport) Upsert Snap allows you to update or insert data from the input view by executing the script generated using the fields provided in the Snap settings.

The Snap updates the table with the values provided in the input view and using the where clause, provides the console output and status code on the output view for any downstream Snap checking for successful execution.

Queries produced by the Snap have the format:

UPDATE table_name SET column1=value1,column2=value2,... WHERE some_column=some_value;
  • 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.

In order to use these Snaps in the pipelines, the respective TPT utilities should be installed and available on the Snapplexes.

Note: 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:

Procedure to install the Teradata tools and utilities:

  • Download the Teradata Tools and Utilities base such as TTU 16.20.25.00 Linux - Base for 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.

Flow: If the tbuild or fastload is already available on the OS path then the corresponding TPT Snap can invoke the required utility. However, if these binaries are not available on the OS path, then you need to provide the absolute path of the respective binary in the Snap.

Snap views

Type Description Examples of upstream and downstream Snaps
Input

This Snap has one or two input views. One for the data and a second optional input view for the target table schema.

Output

This Snap has at most one output view.

Expected output: A single document containing the console output and return status from the external TPT application for each input document.

Learn more about Error handling.

Snap settings

Legend:
  • 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.
Learn more about the icons in the Snap settings dialog.
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 Upsert

Schema name

String/Expression/ Suggestion
The database schema name. In case it is not defined, then the suggestion for the table name will retrieve all tables names of all schemas. The property is suggestible and will retrieve available database schemas during suggest values.
Note: 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. Name of the table to execute the upsert on.
Note: The values can be passed using the pipeline parameters but not the upstream parameter.

Default value: N/A

Example: people

TBUILD location

String/Expression
Location of the tbuild application.
Note: It will be present on the Snaplex.

Default value: /usr/bin/tbuild

Fetch metadata delay (seconds)

Integer/Expression
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

Where columns

String/Expression
Required. Where clause of the select statement. Columns to use in a where condition of the update query to check for existing entries in the target table. The value for the column is given from the input document. Note that the primary columns should be included in both the Where columns and the Primary partition columns properties.

Default value: N/A

Example: email

Primary partition columns

String/Expression
Required. Add all the primary and partition columns for the given table, that are excluded from the "SET" operation as the TPT Script doesn't support the primary or the partition key as update fields.
Note: The TPT Upsert Snap does not support NOPI (No Primary Index) tables.

Default value: N/A

Example: id, name

Snap execution

Dropdown list
Choose one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute. Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only. Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled. Disables the Snap and all Snaps that are downstream from it.

Temporary files

During execution, data processing on Snaplex nodes occurs principally in-memory as streaming and is unencrypted. When processing larger datasets that exceed the available compute memory, the Snap writes unencrypted pipeline data to local storage to optimize the performance. These temporary files are deleted when the pipeline execution completes. You can configure the temporary data's location in the Global properties table of the Snaplex node properties, which can also help avoid pipeline errors because of the unavailability of space. Learn more about Temporary Folder in Configuration Options.