[ https://issues.apache.org/jira/browse/NIFI-7981?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17227076#comment-17227076 ]
ASF subversion and git services commented on NIFI-7981: ------------------------------------------------------- Commit 14ec02f21dde3489e02b94c204eb9b9e24f3c665 in nifi's branch refs/heads/main from Pierre Villard [ https://gitbox.apache.org/repos/asf?p=nifi.git;h=14ec02f ] NIFI-7981 - add support for enum type in avro schema This closes #4648 Signed-off-by: Mike Thomsen <mthom...@apache.org> > ConvertRecord cannot handle open enum in Avro > --------------------------------------------- > > Key: NIFI-7981 > URL: https://issues.apache.org/jira/browse/NIFI-7981 > Project: Apache NiFi > Issue Type: Bug > Affects Versions: 1.12.1 > Reporter: Christophe Monnet > Assignee: Pierre Villard > Priority: Minor > Attachments: record_enum.xml > > Time Spent: 1h > Remaining Estimate: 0h > > This avro schema is using the open enum pattern: > {code:json} > { > "namespace": "acme", > "name": "openEnum", > "type": "record", > "fields": [{ > "name": "personType", > "type": ["null", { > "type": "enum", > "name": "personType_enum", > "symbols": [ > "DRIVER", > "TECHNICIAN" > ] > }, "string"], > "default": null > } > ] > } > {code} > The *personType* can be either null, an enum, or any string. This brings > forward-compatibility. > Using ConvertRecord with > {"personType":"DRIVER"} > as a payload, it works. > But with > {"personType":"DUDE"} > it fails with {{java.lang.NullPointerException: null of acme.personType_enum > of union in field personType of acme.openEnum}} -- This message was sent by Atlassian Jira (v8.3.4#803005)