[ 
https://issues.apache.org/jira/browse/NIFI-6406?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Mollitor resolved NIFI-6406.
----------------------------------
    Resolution: Not A Problem

Woops.

 

The documentation says:

 

{quote}

assuming the Record Writer schema is correctly set

{quote}

 

I did not explicitly set a schema on the JSON Record Writer. I thought it could 
change the schema for me automatically to match the 'extract' requirement.  No 
such luck.  The docs should include the example schema as well as part of the 
example.

> ForkRecord Extract Incorrectly Forks Records
> --------------------------------------------
>
>                 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
>            Priority: Major
>
> 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