You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Nathan English (Jira)" <ji...@apache.org> on 2022/01/25 12:20:00 UTC
[jira] [Created] (NIFI-9629) Avro Writer Schema Default Value not correctly being set
Nathan English created NIFI-9629:
------------------------------------
Summary: Avro Writer Schema Default Value not correctly being set
Key: NIFI-9629
URL: https://issues.apache.org/jira/browse/NIFI-9629
Project: Apache NiFi
Issue Type: Bug
Components: Core Framework
Affects Versions: 1.15.3, 1.15.2, 1.15.1, 1.15.0, 1.16.0
Environment: WSL Ubuntu, Java 11 Open JDK
Reporter: Nathan English
Attachments: Avro_Default_Value_Conversion_Issue_-_20220125.xml
Using the Avro Record Set Writer to create fields that don't exist and set default values is currently causing issues. I haven't tested all the possible types, but below are the ones I have tested:
* String with string default value - OK
* String with null - {color:#FF0000}Error{color}
* Byte with null - {color:#FF0000}Error{color}
* Int with 0 Default value - OK
* Long with 0 default value - {color:#FF0000}Error{color}
{color:#172b4d}Looking at the AvroTypeUtil class when the field is put with its default value the null, is actually an org.apache.avro.JsonProperties$Null instead of an actual null value. The long is actually a default of an int value. These both throw errors when being encoded to the Avro Format.{color}
{color:#172b4d}The attached flow successfully reproduces the errors.{color}
{color:#172b4d}I have tested the flow and it successfully works in v1.12.1, but not a build from the main branch.{color}
{color:#172b4d}This issue leads on from NIFI-9594{color}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)