avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krishna prasad <prasa...@gmail.com>
Subject ArrayIndexOutOfBoundsException when adding new field at child object level in the source
Date Fri, 09 Nov 2012 15:01:54 GMT
Hi,
    We have been facing an issue when we add new field at the child object
level. In out case we are using the following schema for source.

{
    "namespace":"my.pkg.path.avro",
    "type":"record",
    "name":"PeopleList",
    "fields":[{"name":"Version","type":"int"},
        {
            "name":"People","type":{
                "namespace":"my.pkg.path.avro",
                "type":"array",
"items":{"type":"record","namespace":"my.pkg.path.avro","name":"Person","fields":[
                        {"name":"FirstName","type":"string"},
                        {"name":"LastName","type":"string"}
                    ]
                }
            }
        }
    ]
}

If we add any new field to People record then deserialization failing with
the following error.

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
        at java.lang.System.arraycopy(Native Method)
        at
org.apache.avro.io.BinaryDecoder.doReadBytes(BinaryDecoder.java:329)
        at
org.apache.avro.io.BinaryDecoder.readString(BinaryDecoder.java:255)
        at
org.apache.avro.io.ValidatingDecoder.readString(ValidatingDecoder.java:107)
        at
org.apache.avro.generic.GenericDatumReader.readString(GenericDatumReader.java:344)
        at
org.apache.avro.generic.GenericDatumReader.readString(GenericDatumReader.java:337)
        at
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:150)
        at
org.apache.avro.generic.GenericDatumReader.readRecord(GenericDatumReader.java:173)
        at
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:144)
        at
org.apache.avro.generic.GenericDatumReader.readArray(GenericDatumReader.java:202)
        at
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:146)
        at
org.apache.avro.generic.GenericDatumReader.readRecord(GenericDatumReader.java:173)
        at
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:144)
        at
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:135)
        at avro.AvroTest.deserialize(AvroTest.java:140)

I really appreciate any help on this.

Regards,
Krishna

Mime
View raw message