[ 
https://issues.apache.org/jira/browse/AVRO-3099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17428378#comment-17428378
 ] 

Dan Hill commented on AVRO-3099:
--------------------------------

I ended up extending the proto classes and handled this case myself.

> ProtobufDataWriter fails when enum value is UNRECOGNIZED
> --------------------------------------------------------
>
>                 Key: AVRO-3099
>                 URL: https://issues.apache.org/jira/browse/AVRO-3099
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.10.1
>            Reporter: Dan Hill
>            Priority: Major
>
> This happens when the Java job with the protobuf writer has an older version 
> of the protobuf class but receives protobuf data containing new, unrecognized 
> enum values.  When I print out the enum's toString, it returns 'UNRECOGNIZED'.
> 2021-03-29 22:01:33
> org.apache.avro.file.DataFileWriter$AppendWriteException: 
> java.lang.NullPointerException: null of com.example.proto.event.ActionType in 
> field action_type of com.example.proto.event.Action of union in field action 
> of com.example.proto.event.FlatEvent
>       at org.apache.avro.file.DataFileWriter.append(DataFileWriter.java:317)
> ...
> Caused by: java.lang.NullPointerException: null of 
> com.example.proto.event.ActionType in field action_type of 
> com.example.proto.event.Action of union in field action of 
> com.example.proto.event.Record
>       at 
> org.apache.avro.generic.GenericDatumWriter.npe(GenericDatumWriter.java:184)
>       at 
> org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:178)
>       at 
> org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:83)
>       at 
> org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:73)
>       at org.apache.avro.file.DataFileWriter.append(DataFileWriter.java:314)
>       ... 35 more
> Caused by: java.lang.NullPointerException



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to