crunch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Wills (JIRA)" <>
Subject [jira] [Commented] (CRUNCH-485) groupByKey on Spark incorrect if key is Avro record with defined sort order
Date Wed, 07 Jan 2015 05:36:35 GMT


Josh Wills commented on CRUNCH-485:

Strictly speaking, groupByKey doesn't impose sorting unless you pass a GroupingOptions object
with the requireSortedKeys() option enabled; if you pass that in to your example, does it
work as expected? I suppose what I'm saying here is that it doesn't seem like Crunch-on-Spark
should do something that Spark wouldn't do by default, but I'm happy to debate that topic
on the list.

> groupByKey on Spark incorrect if key is Avro record with defined sort order
> ---------------------------------------------------------------------------
>                 Key: CRUNCH-485
>                 URL:
>             Project: Crunch
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 0.11.0
>            Reporter: Tycho Lamerigts
>            Assignee: Josh Wills
> GroupByKey on Spark is incorrect if the key type is an Avro record with defined sort
order (
> Instead, it serializes the entire avro record to a binary blob (byte array) and groups
identical blobs. This is wrong. By contrast, groupByKey on MapReduce works as expected, so
it does take Avro's sort order into account.
> The culprit is probably the following code from org.apache.crunch.impl.spark.collect.PGroupedTableImpl#getJavaRDDLikeInternal
> {code}
> groupedRDD = PairMapFunction(ptype.getOutputMapFn(), runtime.getRuntimeContext()))
>           .mapToPair(new MapOutputFunction(keySerde, valueSerde))
>           .groupByKey(numPartitions);
> {code}
> where MapOutputFunction simply converts the entire key object to a binary blob, without
taking sort order into account.

This message was sent by Atlassian JIRA

View raw message