Table of Contents

Search

  1. Preface
  2. Transformations
  3. Source transformation
  4. Target transformation
  5. Aggregator transformation
  6. Cleanse transformation
  7. Data Masking transformation
  8. Deduplicate transformation
  9. Expression transformation
  10. Filter transformation
  11. Hierarchy Builder transformation
  12. Hierarchy Parser transformation
  13. Hierarchy Processor transformation
  14. Input transformation
  15. Java transformation
  16. Java transformation API reference
  17. Joiner transformation
  18. Labeler transformation
  19. Lookup transformation
  20. Mapplet transformation
  21. Normalizer transformation
  22. Output transformation
  23. Parse transformation
  24. Python transformation
  25. Rank transformation
  26. Router transformation
  27. Rule Specification transformation
  28. Sequence Generator transformation
  29. Sorter transformation
  30. SQL transformation
  31. Structure Parser transformation
  32. Transaction Control transformation
  33. Union transformation
  34. Velocity transformation
  35. Verifier transformation
  36. Web Services transformation

Transformations

Transformations

Inheriting data sources from the parent

Inheriting data sources from the parent

When you configure the data source for an array or struct field, you can choose to use the incoming data or inherit the parent's data sources to populate the children of the field.
When you use the incoming data, the incoming data is used to populate the children of the array or struct.
When you choose to inherit the parent's data sources, the data that is transformed into the parent output field is used to populate the children of the array or struct. Data transformations, such as joins and filters, that are applied to the parent field are preserved. You can apply filters to the field to further filter the data, but you cannot configure data sources, joins, group by fields, or order by fields.
You might want to choose the
Inherit parent's data sources
option when you create a new struct in the output.
For example, you are reading data from a relational table of customer records in which the customer ID is unique. The incoming data contains the following records:
CustID,Name,Street,City,State,ZIP 00234,Ravindra Singh,123 6th St. Apt. 5A,Boston,MA,02134 14416,Melissa Clark,11 Winding Way,Watch Hill,RI,02891
You want to write the customer address fields to a struct.
The following image shows the incoming and output fields:
The image shows the Hierarchy Processor tab of the Hierarchy Processor transformation. The Incoming Fields panel contains one input group with the following string fields: CustID, Name, Street, City, State, and ZIP. The Output Fields panel contains one output group with the following fields: CustID (string), Name (string), and Address (struct). The Address struct contains the following string fields: Street, City, State, and ZIP.
In the Output Fields panel, set the data source for the Output group to
Input
and the data source for the Address struct to
Inherit parent's data sources (Output)
. When you run the mapping,
Data Integration
creates one record for each occurrence of CustID in the input data and populates the struct with the address data that corresponds to the customer ID in the output:
{ "CustID":"00234", "Name":"Ravindra Singh", "Address":{ "Street":"123 6th St. Apt. 5A", "City":"Boston", "State":"MA", "ZIP":"02134" } } { "CustID":"14416", "Name":"Melissa Clark", "Address":{ "Street":"11 Winding Way", "City":"Watch Hill", "State":"RI", "ZIP":"02891" } }
If you set the data source for the Address struct to
Input
, then you must also configure the following filter condition on the struct to get the same output:
:fld.{Input.CustID} = :fld.{Output.CustID} AND :fld.{Input.Name} = :fld.{Output.Name}
. For more information about configuring filter conditions, see Configure filter conditions.
When the output field is an array that inherits its parent's data,
Data Integration
creates an array with one element.