Skip to main content Skip to complementary content

Catching the data rejected by lookup and filter

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

Based on 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

Procedure

  1. In Talend 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.

Collecting rejected data

Procedure

  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 from the row1 main input table and LabelState from the row2 lookup input table on the Reject output table. Another four columns are added to the Reject schema table in the Schema editor.
    Information noteTip:

    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 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

Procedure

  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.

Running the Job

Procedure

  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.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!