Java: GenericDatumReader can fail when reusing objects with unions containing 
'bytes' fields
--------------------------------------------------------------------------------------------

                 Key: AVRO-790
                 URL: https://issues.apache.org/jira/browse/AVRO-790
             Project: Avro
          Issue Type: Bug
          Components: java
            Reporter: Scott Carey
            Assignee: Scott Carey
             Fix For: 1.5.1


GenericDatumReader can fail when reusing GenericRecord objects that contain 
unions of 'bytes' and other types.  

Enhanced unit tests in TestSchema.java uncovered this.

Errors are of the form:
{code}
java.lang.ClassCastException: org.apache.avro.generic.GenericData$Array cannot 
be cast to java.nio.ByteBuffer
        at 
org.apache.avro.generic.GenericDatumReader.readBytes(GenericDatumReader.java:333)
        at 
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:145)
        at 
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:142)
        at 
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:129)
{code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to