You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Doug Cutting (JIRA)" <ji...@apache.org> on 2014/06/24 18:34:25 UTC

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

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

Doug Cutting commented on AVRO-1532:
------------------------------------

Oops.  Just saw that you have provided a test.  Let me look at that more...

> 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, ReflectDataFieldRemovalTest.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)