Search code examples
talend

Throw error on invalid lookup in Talend job that populates an output table


I have a tMap component in a Talend job. The objective is to get a row from an input table, perform a column lookup in another input table, and write an output table populating one of the columns with the retrieved value (see screenshot below).

If the lookup is unsuccessful, I generate a row in an "invalid rows" table. This works fine however is not the solution I'm looking for.

Instead, I want to stop the entire process and throw an error on the first unsuccessful lookup. Is this possible in Talend? The error that is thrown should contain the value that failed the lookup.

enter image description here

UPDATE

enter image description here


Solution

  • A tfileoutputdelimited componenent would do the staff .

    So ,the flow would be as such tMap ->invalid_row->tfileoutputdelimited -> tdie

    Note : that you have to go to advanced settings in the tfileoutputdelimited component aand tick split output into multiple files option and put 1 rather then 1000

    For more flexibility , simply do two tmap order than one tMap