1. Tracing API Response Derived Fields
Data EngineerBackground
An API returns a customer order payload where some fields are calculated on the fly, such as converting cents to dollars and combining names.
Problem
Need to document exactly how the 'totalUsd' and 'customerLabel' fields are derived from the raw database output.
How to use
Paste the raw order JSON, then input the derivation rules specifying that 'totalUsd' comes from 'totalCents' divided by 100, and 'customerLabel' concatenates 'firstName' and 'lastName'.
{
"rules": [
{
"target": "$.order.totalUsd",
"sources": ["$.order.totalCents"],
"transforms": ["divide_by_100", "round(2)"]
},
{
"target": "$.order.customerLabel",
"sources": ["$.order.customer.firstName", "$.order.customer.lastName"],
"transforms": ["concat(\" \")"]
}
]
}Outcome
A JSON lineage graph is generated showing 9 total fields, explicitly linking the 2 derived fields to their original sources and transformation steps.