Filter operators that are coded in the C or C++ , Teradata PT

Tools
Tools covers the tools and utilities you use to work with Teradata and its supporting ecosystem. You'll find information on everything from the Teradata Eclipse plug-in to load/extract tools.
Enthusiast

Filter operators that are coded in the C or C++ , Teradata PT

error.png 

Filter Operators

Filter operators can both consume data from an input data stream and produce data for an output data stream.

Filter operators prevent the output of any data row that contains column values that fail to satisfy filter conditions.

 

  • Teradata PT job scripts can invoke user-written filter operators that are coded in the C or C++.

I created below sample script : But it is not running. TPT utility was stopped working. Please assist me how to use the user written filter operators.

 

DEFINE JOB Filtersample

DESCRIPTION 'use filter from tb_employee'

(

                DEFINE OPERATOR targetfilewriter

                TYPE DATACONNECTOR CONSUMER

                SCHEMA *

                ATTRIBUTES

               (

                               VARCHAR FileName,

                                VARCHAR Format,

                                VARCHAR OpenMode,

                                VARCHAR IndicatorMode,

                                VARCHAR TextDelimiter

               );

 

                DEFINE SCHEMA outputschema

               (

                               EmpID INTEGER,

                               EmpName VARCHAR(20)

               );

 

                DEFINE OPERATOR srctable

               TYPE EXPORT

               SCHEMA outputschema

               ATTRIBUTES

               (

                               VARCHAR UserName,

                                VARCHAR UserPassword,

                                VARCHAR SelectStmt,

                                VARCHAR TdpId

               );

               

  DEFINE OPERATOR MYFILTER ()

  DESCRIPTION 'DUMMY FILTER'

  TYPE FILTER

  INPUT SCHEMA *

  OUTPUT SCHEMA *

  /* Please modify the following path, if necessary, to point to your SampleOperator.dll */

  EXTERNAL NAME 'C:\Program Files\Teradata\Client\13.0\Teradata Parallel Transporter\sdk\Debug\SampleOperator.dll'

  ALLOW PARALLEL

  ATTRIBUTES

  (

   INTEGER FilterFactor = 4

  );

 

                APPLY

               TO OPERATOR

               (

                               targetfilewriter[1]

 

                                ATTRIBUTES

                               (

                                               FileName = 'D:\Murali\tptempout3.txt',

                                                Format = 'DELIMITED',

                                                OpenMode = 'Write',

                                                IndicatorMode = 'N',

                                                TextDelimiter = '|'

                               )

               )

                VIA OPERATOR (MYFILTER())

               SELECT * FROM OPERATOR

               (

                               srctable[1]

 

                                ATTRIBUTES

                               (

                                               UserName = 'user123',

                                                UserPassword = 'user123',

                                                SelectStmt = 'select EmpID,EmpName from BIGM.tbl_employee;',

                                                TdpId = 'dbc'

                               )

               );

  );