You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "O. Reißig (JIRA)" <ji...@apache.org> on 2014/07/14 13:56:04 UTC

[jira] [Updated] (AVRO-1532) Field deletion not possible for ReflectData: NPE

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

O. Reißig updated AVRO-1532:
----------------------------

    Attachment: ReflectData.java.patch

Wouldn't something like this suffice? It allows for fields to be removed from the schema.

> Field deletion not possible for ReflectData: NPE
> ------------------------------------------------
>
>                 Key: AVRO-1532
>                 URL: https://issues.apache.org/jira/browse/AVRO-1532
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.6
>            Reporter: O. Reißig
>              Labels: java, reflection
>         Attachments: AVRO-1532.patch, ReflectData.java.patch, ReflectDataFieldRemovalTest.java, ReflectDataFieldRemovalTest.java, RemovalOfUnionSubtype.java
>
>
> *Actual behaviour:*
> I have a field in my reflection-based schema like this:
> {code}
> @Nullable @AvroDefault("null")
> public Long someField;
> {code}
> When removing this field, parsing the previous serialized blob yields NullPointerException:
> {noformat}
> java.lang.NullPointerException
> 	at org.apache.avro.reflect.ReflectData.setField(ReflectData.java:128)
> 	at org.apache.avro.generic.GenericDatumReader.readField(GenericDatumReader.java:193)
> 	at org.apache.avro.reflect.ReflectDatumReader.readField(ReflectDatumReader.java:230)
> 	at org.apache.avro.generic.GenericDatumReader.readRecord(GenericDatumReader.java:183)
> 	at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:151)
> 	at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:142)
> 	at org.apache.avro.file.DataFileStream.next(DataFileStream.java:233)
> 	at org.apache.avro.file.DataFileStream.next(DataFileStream.java:220)
> 	at ReflectDataFieldRemovalTest.testFieldRemoval(ReflectDataFieldRemovalTest.java:41)
> {noformat}
> *Expected behaviour:*
> Field removal is crucial for schema evolution and must be possible with ReflectData.



--
This message was sent by Atlassian JIRA
(v6.2#6252)