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

ASF subversion and git services commented on NIFI-3919:
-------------------------------------------------------

Commit 40a9cd4f2ead4d0388581921b0de9108a6e97946 in nifi's branch 
refs/heads/master from [~ijokarumawak]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=40a9cd4 ]

NIFI-3919: Let AvroTypeUtil try every possible type

Before this fix, AvroTypeUtil can throw an Exception before trying every 
possible data types defined within a union field.

This closes #1816.


> AvroTypeUtil throws Exception before trying every possible type
> ---------------------------------------------------------------
>
>                 Key: NIFI-3919
>                 URL: https://issues.apache.org/jira/browse/NIFI-3919
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.2.0
>            Reporter: Koji Kawamura
>            Assignee: Koji Kawamura
>
> With a field schema having mixed types, for example, "[null, int, string]", 
> AvroTypeUtil tries to coerce type conversion so that the input raw object can 
> fit with one of possible data type defined in the union.
> If an input string "bar" is passed, we expect it's mapped as "string" data 
> type. However, the "bar" is parsed as integer first, and a 
> NumberFormatException is thrown but not caught, before converting it to 
> "string".
> We surround type conversion with try/catch when AvroTypeUtil tries to find a 
> right type within an union field so that it can check every possible type.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to