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

Trying to read specific avros, getting ClassCastException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.10.0
    • Fix Version/s: 0.8.4, 0.11.0
    • Component/s: IO
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: