[
https://issues.apache.org/jira/browse/NIFI-7390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17102749#comment-17102749
]
ASF subversion and git services commented on NIFI-7390:
-------------------------------------------------------
Commit 66b175f405e727aba650f67872292ff8c8ccb14d in nifi's branch
refs/heads/master from Bence Simon
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=66b175f ]
NIFI-7390 Covering Avro type conversion in case of map withing Record
Signed-off-by: Matthew Burgess <[email protected]>
This closes #4256
> Avro writing fails when narrow data type arrives
> ------------------------------------------------
>
> Key: NIFI-7390
> URL: https://issues.apache.org/jira/browse/NIFI-7390
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Environment: Nifi 1.9 but probably other versions
> Reporter: Simon Bence
> Assignee: Simon Bence
> Priority: Major
> Labels: Record
> Fix For: 1.12.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> We expect a Long during writing the Avro record, but try to write in an
> Integer and as there is no inheritance between them, it fails with class cast
> exception.
> The reason we try to write Integer: the incoming number from JSON is parsed
> by Jackson and unmarshalled based on the value, not the expected schema. If
> the actual value fits to Integer, it will use that, otherwise it will be a
> Long. It has no knowledge of the expected schema. In a later point when we
> consider the input valid (we do allow “narrow number types” both in strict
> and non strict validation), the Avro specific writer thinks it a Long based
> on the validation schema and fails to write it.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)