Creating a flattening map with a single output - 7.3

Talend Data Mapper User Guide

Version
7.3
Language
English
Product
Talend Big Data Platform
Talend Data Fabric
Talend Data Management Platform
Talend Data Services Platform
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Design and Development > Designing Jobs
Last publication date
2023-01-05

Note: This feature is available only if you have installed the R2020-04 Studio monthly update or a later one delivered by Talend. For more information, check with your administrator.

Before you begin

  • You have created a hierarchical structure.

About this task

In this example, the input hierarchical structure looks like this:

Procedure

  1. In the Data Mapper tab of the Mapping perspective, right-click Maps in Hierarchical Mapper and click New > Map.
  2. Select Flattening Map - Create a map which flattens an input structure and click Next.
  3. Select a folder and enter a name for the map, then click Next.
  4. Select the structure that you want to flatten and click Next.
  5. Select a folder and enter a name for the new structure, then click Next.
  6. Optional: Change the pivot by right-clicking the relevant node and clicking Set Pivot.

    The pivot is a path of nodes that starts at the root node and ends at a leaf node. The selected pivot determines the number of rows in the flattened structure.

    You can also remove a node from the pivot by right-clicking it and clicking Remove From Pivot.

  7. Optional: Change the value of the Max Occurs attribute for elements that are not in the pivot.
    • Click the Set Max Occurs for all repeatable elements button to change the value for all repeatable elements.
    • Select one or several nodes and right-click them, then select Set Max Occurs and enter a number. You can select the Apply max occurs to descendant(s) check box if you want to apply this setting to all the descendants of the nodes you selected, then click OK.
  8. Optional: Click the Filter primitive fields button to disable the filter and show all non-looping elements.
    This filter is enabled by default and all primitive fields are included in the output structure. If you want to exclude some of these elements, you can disable the filter and clear the relevant check boxes.
  9. Click Next, select the Create a Studio schema from the flattened structure check box if needed, then click Finish.
    Note: If you select this check box, the output structure will use the Map representation by default. If you clear it, the output will use the CSV representation.

Results

Your map and your flattened output structure are created in the selected folders. The map opens and the elements from the input structure are automatically mapped with the elements in the flat output structure.

In this example, it looks like this:

If you selected Create a Studio schema from the flattened structure, a schema containing the same columns is created. You can find it in your Repository in the Integration perspective, under Metadata > Generic schemas.