[
https://issues.apache.org/jira/browse/CRUNCH-147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Josh Wills updated CRUNCH-147:
------------------------------
Attachment: CRUNCH-147b.patch
Here's my take, Dave. It fixes the integration tests and simply forces
writeTextFile to convert its input PCollection into strings. The tests are
updated for cases where the input PCollection is a PTable and thus need to
expect Pair<K, V>.toString() formatting of the data. What do you think?
> 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-147b.patch, 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