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. 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 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 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!