Scenario 4: Catching the data rejected by lookup and filter - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

The data rejected by the lookup and filter conditions set in tXMLMap can be caught and outputted by this component itself.

Based on Scenario 3: Mapping data using a filter, this scenario presents how to catch the data rejected by the lookup and the filter set up in the previous scenarios. Another tLogRow component is added to the Job used in the previous scenario to display the rejected data.

Adding and linking another output component

  1. In your Studio, open the Job used in the previous scenario to display it in the design workspace.

  2. Add another tLogRow component to the Job by typing its name in the design workspace or dropping it from the Palette.

  3. Link the tXMLMap component to the second tLogRow using a Row > *New Output* (Main) connection. In the pop-up dialog box, enter the name of the output connection, Reject in this example.

Configuring tXMLMap for transformation

  1. Double-click the tXMLMap component to open its Map Editor. An empty Reject output table that carries the rejected data has been added to the output side to represent the output data flow carrying the rejected data.

  2. In the row1 main input table, click the id node and drop it on the Reject output table. A column id is added to the Reject schema table in the Schema editor on the lower part of the map editor.

  3. Do the same to drop CustomerName, CustomerAddress, and idState in the row1 main input table and LabelState in the row2 lookup input table on the Reject output table. Another four columns CustomerName, CustomerAddress, idState, and LabelState are added to the Reject schema table in the Schema editor.

    Note

    In this scenario, the Reject output flow uses the flat data type. However, you can create an XML tree view for this flow similar to the Customer output flow using the Document data type. For further information about how to use the Document type, see Scenario 1: Mapping and transforming XML data.

  4. On the top of the Reject output table, click the button to open the property setting area.

  5. Set the value of the Catch Output Reject property to true to catch the data rejected by the filter set up in the previous scenario for the Customer output flow.

  6. Set the value of the Catch Lookup Inner Join Reject property to true to catch the data rejected by the inner join operation.

  7. Click OK to validate the changes and close the map editor.

Configuring the output flow

  1. Double-click the second tLogRow component to open its Basic settings view.

  2. Click the Sync columns button to retrieve the schema from its preceding component.

  3. In the Mode area, select Table (print values in cells of a table) for better readability of the result.

Saving and executing the Job

  1. Press Ctrl+S to save the Job.

  2. Press F6 to run the Job.

    The captured data rejected by the filter and the lookup reads as follows in the Run view:

    As shown above, the data whose idState value is 2 is selected by the filter set up in the previous scenario and displayed in the upper part, and the data whose idState value is not 2 is rejected and displayed in the lower part.