Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
Nifi 1.9 but probably other versions
Description
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.
Attachments
Issue Links
- links to