spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tgravescs <>
Subject [GitHub] spark pull request: [SPARK-11316] coalesce doesn't handle UnionRDD...
Date Thu, 25 Feb 2016 15:48:55 GMT
Github user tgravescs commented on a diff in the pull request:
    --- Diff: core/src/main/scala/org/apache/spark/rdd/CoalescedRDD.scala ---
    @@ -192,7 +192,8 @@ private class PartitionCoalescer(maxPartitions: Int, prev: RDD[_],
         def resetIterator(): Iterator[(String, Partition)] = {
           val iterators = (0 to 2).map( x =>
             prev.partitions.iterator.flatMap(p => {
    -          if (currPrefLocs(p).size > x) Some((currPrefLocs(p)(x), p)) else None
    +          val locs = currPrefLocs(p)
    +          if (locs.size > x) Some((locs(x), p)) else None
    --- End diff --
    Are you sure on this?  Overall I'm fine with changing but just want to understand for
    locs here is a Seq
    From scaladoc:
    The size of this sequence, equivalent to length
    scala doc says length on sequence also says:
    Note: will not terminate for infinite-sized collections.
    Looking at the scala source code:

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message