nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ericsm <>
Subject How to generate json with array from rows
Date Wed, 13 Dec 2017 16:26:02 GMT

I'm receiving an orders csv, with a single order spanning multiple rows (one
item per row):
order_number, name
123, item_1
123, item_2

I need to convert this to a json, whose simplified format is:
"order_number": "123",
"items": [
{ "name": "item_1" },
{ "name": "item_2" }

Currently to do this I'm passing the entire order CSV into an ExecuteScript
processor, but would like to know if there is a more 'nifi' way to do this.
It seems the first step would be to get nifi to recognize an arbitrary
number of rows as the same record (based on changing order_number), but I
don't see an obvious way to do that.

Thanks in advance,


Sent from:

View raw message