Uploaded image for project: 'Crunch (Retired)'
  1. Crunch (Retired)
  2. CRUNCH-442

Trying to read specific avros, getting ClassCastException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.10.0
    • 0.8.4, 0.11.0
    • IO
    • None

    Description

      I have code that looks like this:

      ArrayList<MySpecificAvro> data = Lists.newArrayList(pipeline.read(From.avroFile(
      "/user/jgauci/data.avro",
      Avros.specifics(MySpecificAvro.class))).materialize());
      for (MySpecificAvro msa : data)

      { System.out.println(msa.getName()); }

      And I get this error:

      Exception in thread "main" java.lang.ClassCastException: org.apache.avro.generic.GenericData$Record cannot be cast to MySpecificAvro

      The error fires inside the for loop after the materialize has completed.

      Attachments

        1. CRUNCH-442.patch
          9 kB
          Gabriel Reid

        Activity

          People

            gabriel.reid Gabriel Reid
            jgmath2000 Jason Gauci
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: