TPT SCHEMA MAPPER OPERATOR example please

Tools & Utilities
Enthusiast

TPT SCHEMA MAPPER OPERATOR example please

Hello All,

I can't find an example anywhere of the TPT Schema Mapper Operator in Action.  Could someone please post an example.

The $SCHEMAP.txt template file in the TPT Install directory has the following in the comments:

......             the "Schema Mapper Operator" chapter   */

/*               in the Teradata Parallel Transporter User Guide,    */

/*               for a discussion and examples of using its key      */

/*               attributes. 

There is no such chapter.   How is it "Applied" ?

Thanks

Tags (1)
1 REPLY
Enthusiast

Re: TPT SCHEMA MAPPER OPERATOR example please

Well, I got it to work.  Here is my working example (cut down). 

To add schema mapping to my working TPT Load job I had to: 

1)  Define a SCHEMAMAPPER Operator

    DEFINE OPERATOR My_SCHEMA_MAP

    DESCRIPTION 'This adds a Data Sample in the Log File'

    TYPE SCHEMAMAPPER

    SCHEMA *

    ATTRIBUTES

    (

        INTEGER RECORDCOUNT = 5,

        VARCHAR DUMPFIELDSWITHTRANS = 'YES',

        VARCHAR DUMPRECORDSWITHTRANS = 'YES',

        VARCHAR TraceLevel = 'None'

    );

2)  Include an extra APPLY.  You end up with two APPLYs, separated by a comma that read from the same FROM OPERATOR.

    STEP LOAD_TABLE

    (

        APPLY

        (

            'INSERT INTO targettable(

            ...

            columns

            ...

            )

            VALUES

            (

           ...

           :variables

           ...

           );'

        )

        TO OPERATOR ( TPT_LOAD_OPERATOR )

        ,

        APPLY TO OPERATOR (MY_SCHEMA_MAP)

        SELECT

            ...

            columns

            ...

        FROM OPERATOR (TPT_ODBC_OPERATOR);

    );

I found this to be very helpful when analysing the incoming data, particularly as I'm reading from an ODBC Operator and not a File.  It uncovered various errors in my SELECT that I could not see without a peek at the data.

I hope you find this useful.