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. Data Services transformation
  9. Deduplicate transformation
  10. Expression transformation
  11. Filter transformation
  12. Hierarchy Builder transformation
  13. Hierarchy Parser transformation
  14. Hierarchy Processor transformation
  15. Input transformation
  16. Java transformation
  17. Java transformation API reference
  18. Joiner transformation
  19. Labeler transformation
  20. Lookup transformation
  21. Machine Learning transformation
  22. Mapplet transformation
  23. Normalizer transformation
  24. Output transformation
  25. Parse transformation
  26. Python transformation
  27. Rank transformation
  28. Router transformation
  29. Rule Specification transformation
  30. Sequence Generator transformation
  31. Sorter transformation
  32. SQL transformation
  33. Structure Parser transformation
  34. Transaction Control transformation
  35. Union transformation
  36. Velocity transformation
  37. Verifier transformation
  38. Web Services transformation

Transformations

Transformations

Hierarchical to flattened example

Hierarchical to flattened example

You want to convert hierarchical data to relational data and write the data to a target file in denormalized format.
A shop maintenance file contains the customer and vehicle information for customers. The file is in hierarchical JSON format and is generated by your company's shop application.
The following JSON script shows the shop maintenance source input before you run the mapping:
{ "people": [{ "personal": { "age": 20, "gender": "M", "name": { "first": "John", "last": "Doe" } }, "vehicles": [{ "type": "car", "model": "Honda Civic", "insurance": { "policy_num": "HA12345" }, "maintenance": [{ "desc": "oil change", "cost": "111.50", "summary": [{ "line1": "0w20", "line2": "synthetic" }, { "line1": "2.0L 4-cyl", "line2": "4.4 quarts" }] }, { "desc": "new tires", "cost": "425.00", "summary": [{ "line1": "235/40R18", "line2": "4 tires" }, { "line1": "All Season", "line2": "No spare" }] }] }, { "type": "truck", "model": "Dodge Ram", "insurance": { "policy_num": "DR12345" }, "maintenance": [{ "desc": "new tires", "cost": "299.99", "summary": [{ "line1": "275/60R20", "line2": "2 tires" }, { "line1": "All Season", "line2": "No spare" }] }, { "desc": "oil change", "cost": "111.50", "summary": [{ "line1": "5w30", "line2": "conventional" }, { "line1": "5.7L V8", "line2": "7.0 quarts" }] }] }], "source": "internet" }, { "personal": { "age": 24, "gender": "F", "name": { "first": "Jane", "last": "Roberts" } }, "vehicles": [{ "type": "car", "model": "Toyota Camry", "insurance": { "policy_num": "TC98765" }, "maintenance": [{ "desc": "tires rotated", "cost": "389.50", "summary": [{ "line1": "4 tires", "line2": "leak repairs" }] }, { "desc": "oil change", "cost": "59.50", "summary": [{ "line1": "0w20", "line2": "special" }] }] }, { "type": "car", "model": "Honda Accord", "insurance": { "policy_num": "HA98765" }, "maintenance": [{ "desc": "new air filter", "cost": "399.50", "summary": [{ "line1": "17220-6B2-A00", "line2": "rebuild assembly" }] }, { "desc": "new brakes", "cost": "799.50", "summary": [{ "line1": "2-443344586", "line2": "rear brake kit" }] }] }], "source": "phone" }] }
You want to denormalize the vehicle maintenance data and exclude the customers' personal information.
Perform the following steps to create and configure the target file:
  1. Step 1. Design the mapping.
  2. Step 2. Configure the output group.
  3. Step 3. Run the mapping.

0 COMMENTS

We’d like to hear from you!