You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@crunch.apache.org by "Gabriel Reid (JIRA)" <ji...@apache.org> on 2014/07/13 19:22:04 UTC

[jira] [Resolved] (CRUNCH-442) Trying to read specific avros, getting ClassCastException

     [ https://issues.apache.org/jira/browse/CRUNCH-442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gabriel Reid resolved CRUNCH-442.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 0.11.0
                   0.8.4
         Assignee: Gabriel Reid

Pushed to master & 0.8 branch

> Trying to read specific avros, getting ClassCastException
> ---------------------------------------------------------
>
>                 Key: CRUNCH-442
>                 URL: https://issues.apache.org/jira/browse/CRUNCH-442
>             Project: Crunch
>          Issue Type: Bug
>          Components: IO
>    Affects Versions: 0.10.0
>            Reporter: Jason Gauci
>            Assignee: Gabriel Reid
>             Fix For: 0.8.4, 0.11.0
>
>         Attachments: CRUNCH-442.patch
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.2#6252)