rpc1235x
2 years agoNew Contributor II
Retrieve a JSON Nested objects as individual lines
Hello
I am having trouble extracting a nested JSON array that looks like this:
{
"name": "Acme",
"color": "blue",
"animal": "dog",
"employee": [ { "first_name": "Bob", "last_name": "Smith", "age": 32 },
{"first_name": "Joe", "last_name": "Doe", "age": 44 } ] }
And my desired output is something like this:
{
"name": "Acme",
"color": "blue,
"animal": "dog",
"first_name": "Bob",
"last_name": "Smith",
"age": 32
},
{
"name": "Acme",
"color": "blue,
"animal": "dog",
"first_name": "Joe",
"last_name": "Doe",
"age": 44
}
I have tried to use two consecutive mappers but that did not work.
I would appreciate any suggestions and pipeline examples, thank you!
#mapper #json #jsonnested
rpc1235x - Below is a pipeline that demonstrates how to use the JSON Splitter for your example. I'm using the JSON Generator to generate your source records.
Hope this clarifies!