[
https://issues.apache.org/jira/browse/NIFI-12797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17824866#comment-17824866
]
ASF subversion and git services commented on NIFI-12797:
--------------------------------------------------------
Commit 8ad3c731dabdf9f951b949ce733e81cdebc06749 in nifi's branch
refs/heads/main from Mark Payne
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=8ad3c731da ]
NIFI-12797 Refactored Record.incorporateInactiveFields
Refactored Record.incorporateInactiveFields to handle when an updated field and
an inactive field have the same name (which can happen if
incorporateInactiveFields is called multiple times). Also refactored the
setValue(String, Object) method to call setValue(RecordField, Object) because
the logic had diverged. Also exposed the text of Expression Language, which led
to the discovery of this bug.
This closes #8413
Signed-off-by: David Handermann <[email protected]>
> Record.incorporateInactiveFields fails if inactive field added with same name
> but different type
> ------------------------------------------------------------------------------------------------
>
> Key: NIFI-12797
> URL: https://issues.apache.org/jira/browse/NIFI-12797
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Reporter: Mark Payne
> Assignee: Mark Payne
> Priority: Major
> Fix For: 2.0.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> The Record.incorporateInactiveFields has a bug in it.
> It considers two cases: updated fields and inactive fields. When considering
> inactive fields, it skips any fields that are also present in the 'updated
> fields'. This makes sense, as we don't want to add a new field if there's
> already a field with the same name.
> However, the comparison it uses is based on RecordField and not the field
> name. So in some cases it can throw an Exception because there's a conflict
> where an inactive field has the same name but different type than an updated
> field.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)