Table of Contents

Search

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

Transformations

Transformations

Hierarchical to relational example

Hierarchical to relational example

A customer order file contains the current customer contact information and the recent orders for those customers. The order file is in hierarchical JSON format and is generated by your company's cloud application. You want to process the hierarchical data and write the data to target files in relational and delimited formats.
Using the order file data, you want to create a relational customers table to use for an update on the customer information in the master database. Separately, you want to analyze the orders that have been increasing. You can use the order file to create a separate delimited orders file for the analysis.
You want to transform the data from the hierarchical input to relational and delimited output.
To create and run the mapping, perform the following tasks:
  1. Ensure that you have access to an Amazon S3 V2 Connector for the S3 source and target objects.
  2. Add a Source transformation that reads hierarchical data from the source JSON file.
  3. Configure the following properties for the source object:
    Property
    Value
    Connection
    Amazon S3 V2
    Source Format
    JSON
  4. Add a Hierarchy Processor transformation. The following image shows the data flow:
    The mapping contains a Source transformation that is connected to a Hierarchy Processor transformation that is connected to two Target transformations.
  5. Create the OutputCustomers output group to create the relational customers data file.
    The following image shows how to add incoming fields, which will create the output group:
    The Hierarchy Processor tab contains a list of incoming fields on the left and output fields on the right. The Add Field dialog box is shown on the right.
  6. Create the
    OutputOrders
    output group to create the delimited orders data file.
  7. In the
    Hierarchy Processor
    tab, map
    Incoming Fields
    to
    Output Fields
    .
    You can add fields individually or use the following options for struct and array fields:
    • Add All Descendants. Adds all children under the field, including all arrays and structs. If the incoming field contains arrays, Data Integration creates a separate output group for each array.
    • Add Single Occurring Children. Adds all single occurring children under the field, even if the single occurring child is nested under a struct.
  8. Add a Target transformation to write the customers data output.
  9. Configure the following properties for the target object:
    Property
    Value
    Connection
    Amazon S3 V2
    Formatting Option
    Relational
  10. Add a Target transformation to write the orders data output.
  11. Configure the following properties for the target object:
    Property
    Value
    Connection
    Amazon S3 V2
    Formatting Option
    Delimited
  12. Link the
    OutputCustomers
    output group to the
    TargetCustomers
    Target transformation.
  13. Link the
    OutputOrders
    output group to the
    TargetOrders
    Target transformation.
  14. Run the mapping.

0 COMMENTS

We’d like to hear from you!