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 F36AA10874 for ; Mon, 16 Sep 2013 18:30:58 +0000 (UTC) Received: (qmail 42282 invoked by uid 500); 16 Sep 2013 18:30:56 -0000 Delivered-To: apmail-crunch-dev-archive@crunch.apache.org Received: (qmail 42143 invoked by uid 500); 16 Sep 2013 18:30:54 -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 42102 invoked by uid 500); 16 Sep 2013 18:30:52 -0000 Delivered-To: apmail-incubator-crunch-dev@incubator.apache.org Received: (qmail 42094 invoked by uid 99); 16 Sep 2013 18:30:52 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Sep 2013 18:30:52 +0000 Date: Mon, 16 Sep 2013 18:30:52 +0000 (UTC) From: "Brian Dougan (JIRA)" To: crunch-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CRUNCH-266) AvroSpecificDeepCopier needs to use constructor on SpecificDatumReader that takes a class. 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-266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13768581#comment-13768581 ] Brian Dougan commented on CRUNCH-266: ------------------------------------- It looks like crunch is already depending on avro 1.7.4, so should be good on that front. Technically, SpecificDatumWriter has the same issue (though doesn't currently manifest in any way since SpecificData and GenericData serialize the same), but it might be a good idea to update both to use the constructors that take classes (in case avro decides to fix it for some reason too). So, I think it might actually be a two line change, one for the reader and writer creation respectively. I'll work on a patch (and try to throw in some unit tests to show the issue if I can figure out a way to get some classloaders configured correctly) > AvroSpecificDeepCopier needs to use constructor on SpecificDatumReader that takes a class. > ------------------------------------------------------------------------------------------ > > Key: CRUNCH-266 > URL: https://issues.apache.org/jira/browse/CRUNCH-266 > Project: Crunch > Issue Type: Bug > Components: Core > Affects Versions: 0.7.0 > Reporter: Brian Dougan > Assignee: Josh Wills > Priority: Minor > > As per https://issues.apache.org/jira/browse/AVRO-1240, when the avro jar is in a parent classloader of the classloader that contains SpecificData classes, a ClassCastException can occur if you don't use the SpecificDatumReader constructor that takes a class (and accounts for the classloader). > Since standard hadoop commands seem to use parent classloaders, and avro is included in the hadoop parent classloader, this issue can be seen if you run a command from a jar including SpecificData classes that attempts to use them from the hadoop command (such as materializing a PCollection of avro objects. > It looks like all that is needed is to update AvroSpecificDatumReader to call a different constructor. > * public SpecificDatumReader(Class c) > To add in more confusion, since avro is an included hadoop dependency, and avro itself had a bug until 1.7.4, this fix will only work if avro in hadoop has been updated to 1.7.4 (or is running on a version that has already done this). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira