You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Adrian Mocanu <am...@verticalscope.com> on 2014/03/19 17:32:43 UTC

partitioning via groupByKey

When you partition via groupByKey tulpes (parts of the RDD) are moved from some node to another node based on key (hash partitioning).
Do the tuples remain part of 1 RDD as before but moved to different nodes or does this shuffling create, say, several RDDs which will have parts of the original RDD?

Thanks
-Adrian


Re: partitioning via groupByKey

Posted by Jaka JanĨar <ja...@kubje.org>.
The former: a single new RDD is returned.

Check the PairRDDFunctions docs (http://spark.apache.org/docs/latest/api/core/index.html#org.apache.spark.rdd.PairRDDFunctions):

def groupByKey(): RDD[(K, Seq[V])]
Group the values for each key in the RDD into a single sequence.


On Wednesday, March 19, 2014 at 9:32 AM, Adrian Mocanu wrote:

> When you partition via groupByKey tulpes (parts of the RDD) are moved from some node to another node based on key (hash partitioning).
> Do the tuples remain part of 1 RDD as before but moved to different nodes or does this shuffling create, say, several RDDs which will have parts of the original RDD?
>  
> Thanks
> -Adrian
>  
> 
> 
>