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 */
There is no such chapter. How is it "Applied" ?
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'
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.
'INSERT INTO targettable(
TO OPERATOR ( TPT_LOAD_OPERATOR )
APPLY TO OPERATOR (MY_SCHEMA_MAP)
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.