DEFINE OPERATOR Statement: Definition - Parallel Transporter

Teradata Parallel Transporter Reference

Product
Parallel Transporter
Release Number
15.10
Language
English (United States)
Last Update
2018-10-07
dita:id
B035-2436
lifecycle
previous
Product Category
Teradata Tools and Utilities

DEFINE OPERATOR Statement: Definition

The following example shows a typical DEFINE OPERATOR statement for a standard Teradata PT operator.

The values assigned to the attributes for the DataConnector operator remain in force throughout the job script, except where they are assigned override values in the APPLY statement reference to this operator object.

DEFINE OPERATOR FILE_READER
     DESCRIPTION 'TERADATA PARALLEL TRANSPORTER DATACONNECTOR OPERATOR'
     TYPE DATACONNECTOR PRODUCER
     EXTERNAL NAME 'MyOperator'
     SCHEMA ReadFilesSchema
     ATTRIBUTES
     (
       VARCHAR OutputLogFileName,
       VARCHAR FileName,
               Format          = 'Delimited',
       VARCHAR OpenMode        = 'Read',
       VARCHAR FileName,
       VARCHAR IndicatorMode   = 'Y',
               RowsPerInstance = 10000
     );

Purpose  

An APPLY statement defines the operations to be executed by a job or job step.

Each job step can contain only one APPLY statement.

Each APPLY statement has two parts:

  • An APPLY clause or two or more APPLY clauses, separated by commas. Each APPLY clause begins with the keyword APPLY and identifies a data destination and the DML statements to be applied to the source data by the specified consumer operator.
  • followed by,

  • A query expression consisting of one or more query specifications, each identifying a data source and optionally using a filter operator and optionally using a Teradata PT where clause “filter,” separated by instances of UNION ALL which combine the data sources into a single source data stream.
  • Note: If the operator in any APPLY clause is a standalone operator, then any DML statements must be self-contained; that is, they must refer to no data external to the DML statements themselves and there can be no query expression.

    For examples of typical APPLY statements job script examples Appendix A of Teradata Parallel Transporter User Guide.

    APPLY statements support the following:

  • Multiple data sources using the UNION ALL query.
  • Multiple data targets using multiple APPLY clauses.
  • Conditional application of DMLs to target tables using CASE DML expressions.
  • Optional data filtering using the WHERE clause and VIA filter operators.
  • Control of the degree of parallelism by specifying the number of instances of each operator.
  • Derivation of new columns using the CASE and SELECT statements.
  • A subset of columns from input rows using the SELECT statement.
  • For information about how to implement multiple APPLY operations in a single job step Teradata Parallel Transporter User Guide.