Member since
01-16-2022
2
Posts
1
Kudos Received
0
Solutions
01-17-2022
05:09 AM
Thanks for the solution! It solves my use case perfectly. Just one question though. I expect the input JSON to the Jolt processor to be somewhat large (larger than the available RAM). In that case, is it absolutely necessary to split the input into multiple files?
... View more
01-16-2022
10:52 AM
1 Kudo
I have the following CSV: mobile username bill_id bill_date product_id product_price 9876543210 John AB10 2020-12-23 X34 500 9876543210 John AB10 2020-12-23 X35 230 9876543210 John AB22 2020-11-14 X89 700 9999999999 Alice AC54 2019-12-20 X10 109 And I want to convert them to the following structure: {
"users": [
{
"mobile": "9876543210",
"username": "John",
"bills": [
{
"bill_id": "AB10",
"bill_date": "2020-12-23",
"products": [{
"product_id": "X34",
"product_price": "500",
},
{
"product_id": "X35",
"product_price": "230",
}]
},
{
"bill_id": "AB22",
"bill_date": "2020-11-14",
"products": [
{
"product_id": "X89",
"product_price": "700",
}]
}]
},
{
"mobile": "9999999999",
"username": "Alice",
"bills": [
{
"bill_id": "AC54",
"bill_date": "2019-12-20",
"products": [
{
"product_id": "X10",
"product_price": "109",
}]
}]
}]
} I wasn't able to figure out how to group the related properties (e.g. product properties with the same bill_id) into an array. How should I go about doing this?
... View more
Labels:
- Labels:
-
Apache NiFi