Six Stars

Export CSV each column of data row

Hi all,

I have a sample data:
Id, col1, col2 col3

1, value1, value2, value3

 

Now I want to check if any value of any column is matched with an other DB table shema by tSchemaComplianceCheck.

And I want to export the id, the name and the value of error column and error message.

Example:
"value1" is an invalid value because it's not an integer (the target schema is integer type), i want export a CSV row:

id, colName, value, errorMessage

1, col1, value1, Not an integer.

 

And if value of col2 is invalid too, then export a new CSV row append to the row exported before.

 

Please give some suggestion. Thanks all.

  • Data Integration
1 REPLY
Community Manager

Re: Export CSV each column of data row

Hello
The reject link of tSchemaComplianceCheck will has the output like

1.png

after tSchemaComplianceCheck, you can use a tExtractDelimitedFields to extract column name and error message from the errorMessage column, eg:

tfileinputdelimited-main-tSchemaComplianceCheck--reject--tExtractDelimitedFields-row2-tMap-->tfileoutputdelimited

 

on tMap: set the expression of column_value column as:

column_name.equals("c1")?row2.c1: (column_name.equals("c2")?row2.c2: (column_name.equals("c3")?row2.c3:row2.id))

 

Regards

Shong

----------------------------------------------------------
Talend | Data Agility for Modern Business