[
https://issues.apache.org/jira/browse/NIFI-8622?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Peter Gyori updated NIFI-8622:
------------------------------
Status: Patch Available (was: In Progress)
The issue was caused by the reuse of a GenericRecord instance in
AvroReaderWithExplicitSchema. When the field was of type "bytes" in our record
(e.g. logicaltype decimal) and the value of the previous record's field used a
larger byte buffer than the current record's same field, then the content of
the byte buffer was not cleared and memory garbage was interpreted as actual
data.
> AvroReader not reading Decimal values correctly when avro file with no
> embedded schema is parsed
> ------------------------------------------------------------------------------------------------
>
> Key: NIFI-8622
> URL: https://issues.apache.org/jira/browse/NIFI-8622
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Reporter: Peter Gyori
> Assignee: Peter Gyori
> Priority: Major
> Attachments: Schemaless_Avro_Decimal_Issue_template.xml
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> When there are multiple records in a FlowFile, and there is a field in these
> records of type Decimal ("type": "bytes", "logicalType": "decimal") and the
> FlowFile is converted to Avro with AvroRecordSetWriter's property "Schema
> Write Strategy" set to "Do not write schema", then when this avro file is
> parsed with AvroReader (Schema access strategy set to "Use 'Schema Text'
> Property" and schema explicitly provided) some decimal values get assigned
> random values.
> Template attached to reproduce the issue.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)