[ https://issues.apache.org/jira/browse/NIFI-5765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16668048#comment-16668048 ]
ASF subversion and git services commented on NIFI-5765: ------------------------------------------------------- Commit db966cf34879ea0d750ae7ab72344b228f889f59 in nifi's branch refs/heads/master from Joe Percivall [ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=db966cf ] NIFI-5765 Fixing WriteJsonResult to use chosenDataType when writing an Array value Fixing the same bug in PutElasticsearchHttpRecord.java This closes #3114. Signed-off-by: Koji Kawamura <ijokaruma...@apache.org> > WriteJsonResult fails with Class Cast Exception when Choice data type > resolves to Array > --------------------------------------------------------------------------------------- > > Key: NIFI-5765 > URL: https://issues.apache.org/jira/browse/NIFI-5765 > Project: Apache NiFi > Issue Type: Bug > Affects Versions: 1.8.0 > Reporter: Joseph Percivall > Assignee: Joseph Percivall > Priority: Major > Fix For: 1.9.0 > > Attachments: Screen Shot 2018-10-29 at 2.35.50 PM.png, > WriteJsonResult_Choice_Array_example.xml > > > The problem is this line[1]. For the casting, it uses the passed in value > instead of the chosen data type. > A template demonstrating the problem is attached. The corner case is hit when > there is a choice of data types, and the data type chosen is Array. It > properly does everything else but fails when casting it due to: > org.apache.nifi.serialization.record.type.ChoiceDataType cannot be cast to > org.apache.nifi.serialization.record.type.ArrayDataType. > [1] > https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/json/WriteJsonResult.java#L379 -- This message was sent by Atlassian JIRA (v7.6.3#76005)