Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Hello
The reject link of tSchemaComplianceCheck will has the output like
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