[ 
https://issues.apache.org/jira/browse/NIFI-4383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16202709#comment-16202709
 ] 

Pierre Villard commented on NIFI-4383:
--------------------------------------

While working on this issue, I realized that the issue is not only limited to 
simple types. Even if we are updating arrays of records, this won't work as-is. 
Besides, if we have an array of records, and we want to update the first one 
and the third one, we would use the following path: {{/records[1,2]}}. However, 
the instances of ArrayIndexFieldValue object are not created successfully: the 
index of each field is always set to 0. In the end, only the first record of 
the array (with index 0) will be updated.

I'll update the description of this JIRA and submit a PR.

> Fix UpdateRecord when updating arrays of simple fields
> ------------------------------------------------------
>
>                 Key: NIFI-4383
>                 URL: https://issues.apache.org/jira/browse/NIFI-4383
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.3.0
>            Reporter: Pierre Villard
>            Assignee: Pierre Villard
>
> At the moment, if trying to use the update record to update an array of 
> simple fields (not records) it won't have any effect.
> Input:
> {noformat}
> {
>   "numbers" : [ 1, null, 4 ]
> }
> {noformat}
> Parameters:
> ||Path||Value||Expected output||
> |{{/numbers[*]}}|{{8}}|{{"numbers" : [ 8, 8, 8 ]}}|
> |{{/numbers[1]}}|{{8}}|{{"numbers" : [ 1, 8, 4 ]}}|
> |{{/numbers[0..1]}}|{{8}}|{{"numbers" : [ 8, 8, 4 ]}}|
> |{{/numbers[0,2]}}|{{8}}|{{"numbers" : [ 8, null, 8 ]}}|



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to