To define the conversion of data from upstream transformations to the hierarchical output, join the incoming data and then map the relationships between fields.
If more than one upstream transformation is connected to the Hierarchy Builder transformation, set primary and foreign keys to join the incoming data before you map the fields. If only one upstream transformation is connected to the Hierarchy Builder transformation, the data will be treated as denormalized input, and you don't define primary and foreign keys. Then, map the input fields to the matching field in the hierarchy.
The Field Mapping tab displays the relational fields from the upstream transformations and the hierarchy fields from the schema. Use this tab to join incoming sources and map the relationships between fields. The following image shows the Field Mapping tab:
Joining incoming data
If more than one upstream transformation is connected to the Hierarchy Builder transformation, set primary and foreign keys to join the incoming data.
You can perform the following actions to set and remove keys:
•To set a field as a key, click the Key column of the field that you want to set, and then specify the field as either a primary or foreign key. When you set a foreign key, you also select the name of the source that contains the related primary key.
•To remove a primary or foreign key designation, click the Key column of the field and select Not a key.
•To clear all the keys, click the action menu at the top of the Hierarchy Fields panel, and then select Clear Keys.
Note: You can set only bigint and string fields as keys.
Mapping relational fields to hierarchy fields
Map relational input fields to hierarchy elements to define how the transformation converts the data.
You can perform the following actions to map and unmap fields:
•To map a relational input field to a schema element, drag the relational field to the schema element.
•To remove a mapped field from a schema element, click the delete icon in the Action column for the schema element.
•To clear all of the mapped fields, click the action menu at the top of the Hierarchy Fields panel and select Clear Mapping.