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

ClassCastException: org.apache.avro.io.parsing.Symbol$Alternative cannot be cast to org.apache.avro.io.parsing.Symbol$UnionAdjustAction

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.3.3
    • 1.4.0
    • java
    • None
    • Reviewed

    Description

      I've got a complicated schema that when deserializing data gives me the following exception:

      java.lang.ClassCastException: org.apache.avro.io.parsing.Symbol$Alternative cannot be cast to org.apache.avro.io.parsing.Symbol$UnionAdjustAction
      at org.apache.avro.io.ResolvingDecoder.readIndex(ResolvingDecoder.java:188)
      at org.apache.avro.io.ParsingDecoder.skipTopSymbol(ParsingDecoder.java:66)
      at org.apache.avro.io.parsing.SkipParser.skipTo(SkipParser.java:71)
      at org.apache.avro.io.parsing.SkipParser.skipSymbol(SkipParser.java:93)
      at org.apache.avro.io.ResolvingDecoder.doAction(ResolvingDecoder.java:207)
      at org.apache.avro.io.parsing.Parser.processImplicitActions(Parser.java:116)
      at org.apache.avro.io.ResolvingDecoder.drain(ResolvingDecoder.java:141)
      at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:72)
      at org.apache.avro.file.DataFileStream.next(DataFileStream.java:195)
      at org.apache.avro.file.DataFileStream.next(DataFileStream.java:182)

      If I go into ResolvingDecoder.readIndex and modify the code to use an instanceof check, my data deserializes perfectly fine.

      I can send all files and unit tests needed to duplicate the error to whomever is working this ticket

      Attachments

        1. AVRO-589.patch
          3 kB
          Thiruvalluvan M. G.

        Activity

          People

            thiru_mg Thiruvalluvan M. G.
            cjcdoomed Christopher Cooper
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: