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

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!