Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Therefore, the outer structures of the document need to agree between the source and target or , else the schema views are not useful. 

As a more complete example, we 'll will build a pipeline that maps the following source document to a target document.

...

The source document is hierarchical since it contains an array of objects, so you need two separate Mapper Snaps: one to map the parent fields and another to map the elements in the "employee" array.  The first Mapper's configuration is pretty simple since it is just changing names:  

SourceTarget
$name$company_name
$employee$workers

The second Mapper will be is connected to the output of the first, so that it can work on the lower levels of the document hierarchy. The "Mapping Root" for this Snap will need to be changed, so that only the objects in the "workers" array will be impacted by the mapping transformations. After setting the root, note that the Input schema changes to only show the fields in the array objects. If there is a target schema available, it is narrowed down to show the "name" and "age" fields.   

Mapping Root: $workers[*]

SourceTarget
$first_name + " " + $last_name$name
$age$age