Scenario 1: Doing an exact match on two columns and outputting the main and rejected data - 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

This scenario describes a five-component Job aiming at carrying out an exact match between the firstnameClient column of an input file against the data of the reference input file, and the lastnameClient column against the data of the reference input file. The outputs of this exact match are written in two separate files: exact data are written in an Excel file, and inaccurate data are written in a delimited file.

In this scenario, we have already stored the input schemas of the input and reference files in the Repository. For more information about storing schema metadata in the Repository tree view, see Talend Studio User Guide.

Dropping and linking the components

  1. In the Repository tree view, expand Metadata and the file node where you have stored the input schemas and drop the relevant file onto the design workspace.

    The [Components] dialog box appears.

  2. Select tFileInputDelimited from the list and click OK to close the dialog box.

    The tFileInputDelimited component displays in the workspace. The input file used in this scenario is called ClientSample. It holds four columns including the two columns firstnameClient and lastnameClient we want to do the exact match on.

  3. Do the same for the second input file you want to use as a reference, ClientSample_Update in this scenario.

  4. Drop the following components from the Palette onto the design workspace: tJoin, tFileOutputExcel, and tFileOutputDelimited.

  5. Connect the main and reference input files to tJoin using Main links. The link between the reference input file and tJoin appears as a lookup link on the design workspace.

  6. Connect tJoin to tFileOutputExcel using the Main link and tJoin to tFileOutputDelimited using the Inner join reject link.

Configuring the components

  1. If needed, double-click the main and reference input files to display their Basic settings views. All their property fields are automatically filled in. If you do not define your input files in the Repository, fill in the details manually after selecting Built-in in the Property Type field.

  2. Double click tJoin to display its Basic settings view and define its properties.

  3. Click the Edit schema button to open a dialog box that displays the data structure of the input files, define the data you want to pass to the output components, three columns in this scenario, idClient, firstnameClient and lastnameClient, and then click OK to validate the schema and close the dialog box.

  4. In the Key definition area of the Basic settings view of tJoin, click the plus button to add two columns to the list and then select the input columns and the output columns you want to do the exact matching on from the Input key attribute and Lookup key attribute lists respectively, firstnameClient and lastnameClient in this example.

  5. Select the Inner join (with reject output) check box to define one of the outputs as inner join reject table.

  6. Double click tFileOutputExcel to display its Basic settings view and define its properties.

  7. Set the destination file name and the sheet name, and select the Include header check box.

  8. Double click tFileOutputDelimited to display its Basic settings view and define its properties.

  9. Set the destination file name, and select the Include header check box.

Saving and executing the Job

  1. Press Ctrl+S to save your Job.

  2. Press F6, or click Run on the Run tab to execute the Job.

    The output of the exact match on the firstnameClient and lastnameClient columns is written to the defined Excel file.

    The rejected data is written to the defined delimited file.