0

I have 2 json Flowfile generated from different source(DB/file system).

First process generates json multiple FlowFiles in below format:

{
"sku_id": 1,
"desc": "desc1"
}

Second flowFile has multiple json array of sku's in file:

    {
        "sku_id": 1,
        "name": "nam1"
    },
    {
        "sku_id": 2,
        "name": "nam2"
    }

I want to merge above 2 json and create a result json as below:

    {
        "sku_id": 1,
        "name": "nam1",
        "desc": "desc1"
    }

Is this kind of merge process possible in nifi, closest that I could search for is QueryRecord processor, but did not find any example around json.

Any idea how do I merge the 2 flowfiles?

Bikas Katwal
  • 1,895
  • 1
  • 21
  • 42
  • A similar question was answered here: https://stackoverflow.com/questions/42908838/how-to-join-two-csvs-with-apache-nifi – Bryan Bende Jun 06 '18 at 12:41
  • i think it's possible to use MergeContent to merge both files into one json file, then use ExecuteScript to parse and merge data logically. – daggett Jun 06 '18 at 15:16
  • Possible duplicate of [How to join two CSVs with Apache Nifi](https://stackoverflow.com/questions/42908838/how-to-join-two-csvs-with-apache-nifi) – arghtype Jun 14 '18 at 22:56

0 Answers0