[
https://issues.apache.org/jira/browse/NIFI-3838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16004884#comment-16004884
]
ASF GitHub Bot commented on NIFI-3838:
--------------------------------------
Github user mattyb149 commented on the issue:
https://github.com/apache/nifi/pull/1772
I ran into some trouble when the input schema was different from the output
schema. One example is an input record with an "id" field and a nested "name"
field with "first" and "last" fields. The output schema has "id" and "name"
fields. When trying to update the outgoing "name" field with the "/name/first"
field value, I got the following error:
`IllegalTypeConversionException: Cannot convert value [Matt] of type class
java.lang.String to Record for field name`
This appears to be caused by the fact that the input and output schemas
have the same field name with different types. However when I tried an output
schema of "id" and "firstName", there was no exception but the "firstName"
field was null.
Looks like the input schema and record is used to update the incoming
record in-place, versus updating from the incoming record to an outgoing record.
> Create UpdateRecord processor and provide a RecordPath DSL to specify fields
> ----------------------------------------------------------------------------
>
> Key: NIFI-3838
> URL: https://issues.apache.org/jira/browse/NIFI-3838
> Project: Apache NiFi
> Issue Type: New Feature
> Reporter: Mark Payne
> Assignee: Mark Payne
>
> With the addition of the RecordReader and RecordWriter controller services,
> it would be nice to have a Processor that is capable of updating specific
> fields of a record, based on user-defined values or based on the value of
> another field in the Record.
> To do so, we need some sort of DSL that would allow us to access a specific
> field in a record - something akin to JsonPath but that will work on any
> Record object.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)