Hi feinholz,
It seems that we can't refer schema definition from job variable. I have the following generic TPT template:
USING CHARACTER SET UTF8
DEFINE JOB EXPORT_TO_INDICDATA_FILE_FORMAT
DESCRIPTION 'Export from ' || @SourceTableName || ' to the INDICDATA file: ' || @DataFileName
(
DEFINE SCHEMA DATA_FILE_SCHEMA
(
@DataFileSchema
);
DEFINE OPERATOR EXPORT_OPERATOR
TYPE EXPORT
SCHEMA DATA_FILE_SCHEMA
ATTRIBUTES
(
VARCHAR PrivateLogName = @SourceTableName || '.log',
VARCHAR TdpId = @TdpId,
VARCHAR UserName = @UserName,
VARCHAR UserPassword = @UserPassword,
VARCHAR DateForm = 'INTEGERDATE',
VARCHAR SelectStmt = 'select * from ' || @SourceTableName
);
And I put the column definition in a *.jobvars file like below:
SourceTableName='scratch_ds.My_Data_Type_Test'
DataFilePath='/export/home/esun/data'
DataFileName='my_data_type_test.indicdata.dat'
DataFileCount=1
DataFileSchema='"pid" Integer,
"pcode" Char(30),
"pname" Varchar(96),
"udate" IntDate,
"utime" Time(6),
"utimestamp0" Timestamp(0),
"utimestamp3" Timestamp(3),
"utimestamp6" Timestamp(6),
"utimestamptz" Timestamp(6) With Time Zone,
"price" Decimal(15,2),
"weight" Float,
"weight_flag" Char(3),
"lenght" Float,
"serialnum" Decimal(18,0),
"auditnum" BigInt,
"username" Varchar(60)'
But at run time, TPT complains:
Teradata Parallel Transporter Version 13.10.00.09
TPT_INFRA: Syntax error at or near line 25 of Job Script File 'tpt_export_template.txt':
TPT_INFRA: At ""pid" Integer,"pcode" Char(30),"pname" Varchar(96),"udate" IntDate,"utime" Time(6),"utimestamp0" Timestamp(0),"utimestamp3" Timestamp(3),"utimestamp6" Timestamp(6),"utimestamptz" Timestamp(6) With Time Zone,"price" Decimal(15,2),"weight" Float,"weight_flag" Char(3),"lenght" Float,"serialnum" Decimal(18,0),"auditnum" BigInt,"username" Varchar(60)" missing RPAREN_ in Rule: Explicit Schema Element List
TPT_INFRA: Syntax error at or near line 27 of Job Script File 'tpt_export_template.txt':
TPT_INFRA: TPT03020: Rule: DEFINE SCHEMA
Compilation failed due to errors. Execution Plan was not generated.
But if I just paste the content of DataFileSchema into the TPT script directly, it works fine.
Can you please comment on this? Is this fixed in 14.x? I am going to upgrade to 14.x in 2 months.
Thanks a bunch!
↧