David Mollitor created NIFI-6406:
------------------------------------

             Summary: ForkReader Extract Not Working As Advertised
                 Key: NIFI-6406
                 URL: https://issues.apache.org/jira/browse/NIFI-6406
             Project: Apache NiFi
          Issue Type: Improvement
          Components: Core Framework
    Affects Versions: 1.9.2
            Reporter: David Mollitor


I am looking at the {{ForkRecord}} processor and trying to reproduce the 
example provided here:

[https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.9.2/org.apache.nifi.processors.standard.ForkRecord/additionalDetails.html]

In particular, I am looking at _Example 2 - Extracting with parent fields_

My input:
{code}
[{
        "id": 1,
        "name": "John Doe",
        "address": "123 My Street",
        "city": "My City",
        "state": "MS",
        "zipCode": "11111",
        "country": "USA",
        "accounts": [{
                "id": 42,
                "balance": 4750.89
        }, {
                "id": 43,
                "balance": 48212.38
        }]
},
{
        "id": 2,
        "name": "Jane Doe",
        "address": "345 My Street",
        "city": "Her City",
        "state": "NY",
        "zipCode": "22222",
        "country": "USA",
        "accounts": [{
                "id": 45,
                "balance": 6578.45
        }, {
                "id": 46,
                "balance": 34567.21
        }]
}]
{code}
My output:
{code}
[ {
  "id" : 42,
  "name" : "John Doe",
  "address" : "123 My Street",
  "city" : "My City",
  "state" : "MS",
  "zipCode" : "11111",
  "country" : "USA",
  "accounts" : [ {
    "id" : 42,
    "balance" : 4750.89
  }, {
    "id" : 43,
    "balance" : 48212.38
  } ]
}, {
  "id" : 43,
  "name" : "John Doe",
  "address" : "123 My Street",
  "city" : "My City",
  "state" : "MS",
  "zipCode" : "11111",
  "country" : "USA",
  "accounts" : [ {
    "id" : 42,
    "balance" : 4750.89
  }, {
    "id" : 43,
    "balance" : 48212.38
  } ]
}, {
  "id" : 45,
  "name" : "Jane Doe",
  "address" : "345 My Street",
  "city" : "Her City",
  "state" : "NY",
  "zipCode" : "22222",
  "country" : "USA",
  "accounts" : [ {
    "id" : 45,
    "balance" : 6578.45
  }, {
    "id" : 46,
    "balance" : 34567.21
  } ]
}, {
  "id" : 46,
  "name" : "Jane Doe",
  "address" : "345 My Street",
  "city" : "Her City",
  "state" : "NY",
  "zipCode" : "22222",
  "country" : "USA",
  "accounts" : [ {
    "id" : 45,
    "balance" : 6578.45
  }, {
    "id" : 46,
    "balance" : 34567.21
  } ]
} ]
{code}
I expect there to be 4 records (2x2) and there are,... but each record caries 
all of the fields instead of extracting them (see the output example in the 
docs).  It looks more like a cross-join than anything.

The 'split' function worked as expected.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to