crunch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Tzolov (JIRA)" <>
Subject [jira] [Commented] (CRUNCH-204) MemPipeline.write() is inconsistent with
Date Fri, 10 May 2013 10:01:16 GMT


Christian Tzolov commented on CRUNCH-204:

patch is committed
> MemPipeline.write() is inconsistent with
> -----------------------------------------------------------
>                 Key: CRUNCH-204
>                 URL:
>             Project: Crunch
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Ben Roling
>            Assignee: Josh Wills
>         Attachments: CRUNCH-204.patch
> of a file written with MemPipeline.write(collection,
AvroFileTarget) fails with Not a data file.
> I seems the way the file is written is inconsistent with the way it is read.  The appears
to not actually be written out in Avro format.  It seems MemPipeline.write() simply does a
toString() on each of the elements in the collection and spits that out to the target's path
with each element separated by a newline.
> Here is a simple test that demonstrates the issue:
> {code}
> final Pipeline memPipeline = MemPipeline.getInstance();
>         final String path = "persons";
>         final PCollection<Person> persons = MemPipeline.collectionOf(Collections.singleton(new
Person("John Doe")));
>         memPipeline.write(persons, new AvroFileTarget(path));
>         // throws IOException!
> AvroFileSource<Person>(new Path(path), Avros.records(Person.class)));
> {code}
> The Person class in the example is is based on this simple Avro schema:
> {code}
> @namespace("")
> protocol PersonProtocol {
>   record Person {
>     string name;
>   }
> }
> {code}
> This is pretty confusing behavior.  I ran into it trying to do some simple testing and
it took me longer than I'd like to admit to figure out what was going on.  I imagine others
will run into it and be similarly confused.
> I've left the priority as the default of Major although I suppose that point could be
argued.  Reset it as you like.

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:

View raw message