spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Ash (JIRA)" <>
Subject [jira] [Commented] (SPARK-1021) sortByKey() launches a cluster job when it shouldn't
Date Wed, 09 Apr 2014 14:26:18 GMT


Andrew Ash commented on SPARK-1021:

I tried making the change of making that val lazy and a cluster job was still launched, so
it'll need to be a more involved fix than just adding lazy.

The PR for that is probably somewhere on an old github repo.

> sortByKey() launches a cluster job when it shouldn't
> ----------------------------------------------------
>                 Key: SPARK-1021
>                 URL:
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>    Affects Versions: 0.8.0, 0.9.0
>            Reporter: Andrew Ash
>              Labels: starter
> The sortByKey() method is listed as a transformation, not an action, in the documentation.
 But it launches a cluster job regardless.
> Some discussion on the mailing list suggested that this is a problem with the rdd.count()
call inside Partitioner.scala's rangeBounds method.
> Josh Rosen suggests that rangeBounds should be made into a lazy variable:
> {quote}
> I wonder whether making RangePartitoner .rangeBounds into a lazy val would fix this (
 We'd need to make sure that rangeBounds() is never called before an action is performed.
 This could be tricky because it's called in the RangePartitioner.equals() method.  Maybe
it's sufficient to just compare the number of partitions, the ids of the RDDs used to create
the RangePartitioner, and the sort ordering.  This still supports the case where I range-partition
one RDD and pass the same partitioner to a different RDD.  It breaks support for the case
where two range partitioners created on different RDDs happened to have the same rangeBounds(),
but it seems unlikely that this would really harm performance since it's probably unlikely
that the range partitioners are equal by chance.
> {quote}
> Can we please make this happen?  I'll send a PR on GitHub to start the discussion and

This message was sent by Atlassian JIRA

View raw message