From crunch-dev-return-1842-apmail-incubator-crunch-dev-archive=incubator.apache.org@incubator.apache.org Tue Jan 22 14:26:14 2013 Return-Path: X-Original-To: apmail-incubator-crunch-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-crunch-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 92503E499 for ; Tue, 22 Jan 2013 14:26:14 +0000 (UTC) Received: (qmail 69891 invoked by uid 500); 22 Jan 2013 14:26:13 -0000 Delivered-To: apmail-incubator-crunch-dev-archive@incubator.apache.org Received: (qmail 69809 invoked by uid 500); 22 Jan 2013 14:26:13 -0000 Mailing-List: contact crunch-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: crunch-dev@incubator.apache.org Delivered-To: mailing list crunch-dev@incubator.apache.org Received: (qmail 69785 invoked by uid 99); 22 Jan 2013 14:26:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Jan 2013 14:26:13 +0000 Date: Tue, 22 Jan 2013 14:26:13 +0000 (UTC) From: "Dave Beech (JIRA)" To: crunch-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CRUNCH-147) Pipeline.writeTextFile should work with Avro data 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-147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dave Beech updated CRUNCH-147: ------------------------------ Attachment: CRUNCH-147.patch It looks like this can be made to work by removing the WritableTypeFamily.as(..) call that wraps the collection's type (see patch). I haven't run any integration testing and I would expect there to have been a good reason to have this call in the first place, so please feel free to tell me this is a bad idea! > Pipeline.writeTextFile should work with Avro data > ------------------------------------------------- > > Key: CRUNCH-147 > URL: https://issues.apache.org/jira/browse/CRUNCH-147 > Project: Crunch > Issue Type: Improvement > Components: Core > Affects Versions: 0.4.0 > Reporter: Dave Beech > Assignee: Josh Wills > Priority: Minor > Attachments: CRUNCH-147.patch > > > I'd find it useful to be able to dump Avro collections to a text file (as json) during development to have a quick look inside without having to mess around with avro-tools. The current Pipeline.writeTextFile method expects Writables and gives the following error when you attempt to pass Avro to it: > Exception in thread "main" java.lang.ClassCastException: class my.avro.Record > at java.lang.Class.asSubclass(Class.java:3018) > at org.apache.crunch.types.writable.Writables.records(Writables.java:250) > at org.apache.crunch.types.writable.WritableTypeFamily.records(WritableTypeFamily.java:86) > at org.apache.crunch.types.PTypeUtils.convert(PTypeUtils.java:61) > at org.apache.crunch.types.writable.WritableTypeFamily.as(WritableTypeFamily.java:135) -- 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