Scenario 1: Using Talend Data Mapper metadata - 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 following scenario creates a three-component Job, reading data from an input file that is transformed using a map that was previously created in the Mapping perspective and then outputting the transformed data in a new file. It works with Talend Data Mapper metadata.

Copying an editable version of the example files

  1. In the Mapping perspective, in the Data Mapper view, expand the Hierarchical Mapper node and the Other Projects folder, right-click Examples and then select Copy in the contextual menu.

  2. In the Data Mapper view, right-click at the root of the Hierarchical Mapper node, and then select Paste in the contextual menu.

    This copies an editable version of all the read-only example files to your local workspace.

Adding and linking the components

  1. In the Integration perspective, create a new Job and call it tdm_to_tdm.

  2. Click the point in the design workspace where you want to add the first component, start typing tFileInputRaw, and then click the name of the component when it appears in the list proposed in order to select it.

  3. Do the same to add a tHMap component and a tFileOutputRaw component as well.

  4. Connect the tFileInputRaw component to the tHMap component using a Row > Main link and rename it input, then connect the tHMap component to the tFileOutputRaw component using a Row > Main link and name it output. When you are asked if you want to get the schema of the target component, click Yes.

Defining the properties of tFileInputRaw

  1. Select the tFileInputRaw component to define its properties.

  2. In the Basic settings tab, click the [...] button next to the Filename field then browse to the location on your file system where the input file is stored, or enter the path manually between double quotes. For this example, use <PATH_TO_WORKSPACE>/<PROJECT_NAME>/Sample Data/CSV/PurchaseOrderPayPal/PayPalPO.csv.

  3. Set the Mode as Read the file as a string, and leave all the other parameters unchanged.

Defining the properties of tFileOutputRaw

  1. Select the tFileOutputRaw component to define its properties.

  2. In the Basic settings tab, click the [...] button then browse to the location on your file system where the output file is to be stored, or enter the path manually between double quotes. Leave the other parameters unchanged.

Defining the properties of tHMap

  1. Select the tHMap component to define its properties.

  2. Click the [...] button next to the Map Path field to open the picker and select the map to use, Maps/CSV/POPayPalCsv_PO2, then click OK. This map transforms a CSV file into an XML file.

  3. Check that Read Input As is set to Single Column.

  4. Check that Write Output As is set to String (single column).

Saving and executing the Job

  1. Press Ctrl+S to save your Job.

  2. In the Run tab, click Run to execute the Job.

  3. Browse to the location on your file system where the output file is stored to check that an XML file has been created containing the same data as the input CSV file.