Table of Contents

Search

  1. Preface
  2. Transformations
  3. Source transformation
  4. Target transformation
  5. Access Policy transformation
  6. Aggregator transformation
  7. B2B transformation
  8. Chunking transformation
  9. Cleanse transformation
  10. Data Masking transformation
  11. Data Services transformation
  12. Deduplicate transformation
  13. Expression transformation
  14. Filter transformation
  15. Hierarchy Builder transformation
  16. Hierarchy Parser transformation
  17. Hierarchy Processor transformation
  18. Input transformation
  19. Java transformation
  20. Java transformation API reference
  21. Joiner transformation
  22. Labeler transformation
  23. Lookup transformation
  24. Machine Learning transformation
  25. Mapplet transformation
  26. Normalizer transformation
  27. Output transformation
  28. Parse transformation
  29. Python transformation
  30. Rank transformation
  31. Router transformation
  32. Rule Specification transformation
  33. Sequence transformation
  34. Sorter transformation
  35. SQL transformation
  36. Structure Parser transformation
  37. Transaction Control transformation
  38. Union transformation
  39. Vector Embedding transformation
  40. Velocity transformation
  41. Verifier transformation
  42. 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 populate the children of the field either with the incoming data or by inheriting the parent's data sources.
When you use the incoming data, the incoming data is used to populate the children of the array or struct.
When you inherit the parent's data sources, the data transformed into the parent output field populates the children of the array or struct. This preserves the data transformations (for example, joins and filters), in the parent fields. You can apply filters to the field to further filter the data, but you can't configure data sources, joins, group by fields, or order by fields.
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, the Hierarchy Processor transformation 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, the Hierarchy Processor transformation creates an array with one element.

0 COMMENTS

We’d like to hear from you!