avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From O. Reißig (JIRA) <j...@apache.org>
Subject [jira] [Updated] (AVRO-1532) Field deletion not possible for ReflectData: NPE
Date Tue, 24 Jun 2014 08:15:24 GMT

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

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

    Description: 
*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.

  was:
*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}
Caused by: 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:155)
        at org.apache.avro.generic.GenericDatumReader.readMap(GenericDatumReader.java:256)
        at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:154)
        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.readMap(GenericDatumReader.java:256)
        at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:154)
        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)
{noformat}

*Expected behaviour:*
Field removal is crucial for schema evolution and must be possible with ReflectData.


> 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
>         Attachments: 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)

Mime
View raw message