[
https://issues.apache.org/jira/browse/NIFI-5606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16620401#comment-16620401
]
Pierre Villard edited comment on NIFI-5606 at 9/19/18 10:08 AM:
----------------------------------------------------------------
Hey [~JPercivall] - I just had a look and, based on the code, it seems to be on
purpose [1]. I'll defer to [~markap14] if that's something we want to change or
not. Not sure that would be easy to implement as we would have to create the
parent record (and potentially to do it recursively in case you have multiple
nested records).
[1]
https://github.com/apache/nifi/blob/master/nifi-commons/nifi-record-path/src/main/java/org/apache/nifi/record/path/StandardFieldValue.java#L126
was (Author: pvillard):
Hey [~JPercivall] - I just had a look and, based on the code, it seems to be on
purpose [1]. I'll defer to [~markap14] if that's something we want to change or
not. Not sure that would be easy to implement as we would have to create the
parent record (and potentially to do it recursively in case you have multiple
nested records).
> UpdateRecord doesn't allow population of nested fields if input parent is null
> ------------------------------------------------------------------------------
>
> Key: NIFI-5606
> URL: https://issues.apache.org/jira/browse/NIFI-5606
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 1.7.1
> Reporter: Joseph Percivall
> Priority: Major
>
> To reproduce, open the TestUpdateRecord.java processor and change the dynamic
> properties in testFieldValuesInEL[1] to the following:
> {noformat}
> runner.setProperty("/name/last", "NiFi");
> runner.setProperty("/name/first", "Apache");{noformat}
>
> Also, change person.json[2] to have no name field:
>
> {noformat}
> {
> "id": 485,
> "mother": {
> "last": "Doe",
> "first": "Jane"
> }
> }{noformat}
>
> After running, the output is:
>
> {noformat}
> [ { "id" : 485, "name" : null } ]{noformat}
>
> Where the expected output would be:
> {noformat}
> {
> "id": 485,
> "name": {
> "last": "NiFi",
> "first": "Apache"
> }
> }
> {noformat}
>
> [1][https://github.com/apache/nifi/blob/4c787799ff7d971eb924df1e496da8338e6ab192/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestUpdateRecord.java#L303]
> [2]
> [https://github.com/apache/nifi/blob/9ebf2cfaf1fdb1a28427aed5a8168004071efd12/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/resources/TestUpdateRecord/input/person.json#L3]
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)