Return-Path: X-Original-To: apmail-crunch-dev-archive@www.apache.org Delivered-To: apmail-crunch-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C963A11977 for ; Sun, 13 Jul 2014 17:22:04 +0000 (UTC) Received: (qmail 50186 invoked by uid 500); 13 Jul 2014 17:22:04 -0000 Delivered-To: apmail-crunch-dev-archive@crunch.apache.org Received: (qmail 50135 invoked by uid 500); 13 Jul 2014 17:22:04 -0000 Mailing-List: contact dev-help@crunch.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@crunch.apache.org Delivered-To: mailing list dev@crunch.apache.org Received: (qmail 50120 invoked by uid 500); 13 Jul 2014 17:22:04 -0000 Delivered-To: apmail-incubator-crunch-dev@incubator.apache.org Received: (qmail 50117 invoked by uid 99); 13 Jul 2014 17:22:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Jul 2014 17:22:04 +0000 Date: Sun, 13 Jul 2014 17:22:04 +0000 (UTC) From: "Gabriel Reid (JIRA)" To: crunch-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CRUNCH-442) Trying to read specific avros, getting ClassCastException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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 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)