Step 2: Mapping and transformations - 8.0

Data Integration Job Examples

Version
8.0
Language
English
Product
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 ESB
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Design and Development > Designing Jobs
Last publication date
2024-02-06

This step transforms the data from the input file using a tMap component.

The tMap component can handle:

  • multiple inputs and outputs
  • search for reference (simple, cartesian product, first, last match...)
  • join (inner, outer)
  • transformations
  • rejections
  • and more...

Procedure

  1. Remove the link between the two components by right-clicking the link and selecting Delete option. Then place the tMap of the Processing component group in between before linking the input component to the tMap.
  2. Connect the tFileInputDelimited component to the tMap component using a Row > Main link.
  3. Right-click the tMap component, select Row > *New Output* (Main) and click the tLogRow component. Type in out1 in the dialog box to implement the link. Logically, a message box shows up (for the back-propagation of schemas), ignore it by clicking No.
  4. Double-click the tMap to access its interface.
    The left part displays the schema (description) of the input file (row1). The right part displays the output schema (out1).
  5. Drop the Firstname and Lastname columns to the right, onto the Name column as shown on the screen below. Then drop the other columns Address and City to their respective line.
    Results of the mapping of columns.
  6. Carry out the following transformations on each column:
    • Change the Expression of the Name column to row1.Firstname + " " + row1.LastName. This concatenates the Firstname column with the Lastname column.
    • Change the Expression of the Address column to row1.Address.toUpperCase(), which changes the address case to upper case.
  7. Remove the Lastname column from the out1 table and increase the length of the remaining columns. To do so, go to the Schema Editor located at the bottom of the Map editor and proceed as follows:
    Screenshot of the Schema Editor.
    1. Select the column to be removed from the schema and click the cross icon.

    2. Select the column of which you need increase the length size.

    3. Type in the length size you intend in the length column. In this example, change the length of every remaining column to 40.

    Note: As the first name and the last name of a client are concatenated, it is necessary to increase the length of the name columns in order to match the full name size. No transformation is made to the City column.
  8. Click OK to validate the changes and close the Map editor interface.
  9. Run your Job.
    Screenshot of the console after successfully running the Job.

Results

The addresses are displayed in upper case and the first names and last names are gathered in the same column.