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