[ 
https://issues.apache.org/jira/browse/AVRO-3993?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gray updated AVRO-3993:
-----------------------
    Description: 
{{When an enum field is written with a symbol that is not one of the valid enum 
symbols configured in the schema, the code generates a NPE which turns into a 
null value message:}}

{{{{java.lang.NullPointerException: null value for (non-nullable) enum1 at 
record1.field1
     at 
org.apache.avro.path.TracingNullPointException.summarize(TracingNullPointException.java:88)
     ...
Caused by: java.lang.NullPointerException
     at org.apache.avro.Schema$EnumSchema.getEnumOrdinal(Schema.java:1118)
...}}}}

  was:
{{When an enum field is written with a symbol that is not one of the valid enum 
symbols configured in the schema, the code generates a NPE which turns into a 
missing field value or something equally unhelpful.}}

{{{{java.lang.NullPointerException: null value for (non-nullable) enum1 at 
record1.field1
}}}}{{{{      at 
org.apache.avro.path.TracingNullPointException.summarize(TracingNullPointException.java:88)
      at 
org.apache.avro.path.TracingNullPointException.summarize(TracingNullPointException.java:1)
 at 
org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:84) at 
org.apache.avro.TestSchema.enumWriteUnknownField(TestSchema.java:667) at 
java.base/java.lang.reflect.Method.invoke(Method.java:566) at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at 
java.base/java.util.ArrayList.forEach(ArrayList.java:1541) Caused by: 
java.lang.NullPointerException at 
org.apache.avro.Schema$EnumSchema.getEnumOrdinal(Schema.java:1118)
...}}}}


> Writing an AVRO enum field with an invalid value generates unhelpful NPE
> ------------------------------------------------------------------------
>
>                 Key: AVRO-3993
>                 URL: https://issues.apache.org/jira/browse/AVRO-3993
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Gray
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: avro-stacktrace.txt
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {{When an enum field is written with a symbol that is not one of the valid 
> enum symbols configured in the schema, the code generates a NPE which turns 
> into a null value message:}}
> {{{{java.lang.NullPointerException: null value for (non-nullable) enum1 at 
> record1.field1
>      at 
> org.apache.avro.path.TracingNullPointException.summarize(TracingNullPointException.java:88)
>      ...
> Caused by: java.lang.NullPointerException
>      at org.apache.avro.Schema$EnumSchema.getEnumOrdinal(Schema.java:1118)
> ...}}}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to