Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-790

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.5.1
    • java
    • None

    Description

      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:

      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)
      

      Attachments

        1. AVRO-790.patch
          4 kB
          Scott Carey

        Activity

          People

            scott_carey Scott Carey
            scott_carey Scott Carey
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: