spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tgravescs <...@git.apache.org>
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:

    https://github.com/apache/spark/pull/11327#discussion_r54115176
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/CoalescedRDD.scala ---
    @@ -192,7 +192,8 @@ private class PartitionCoalescer(maxPartitions: Int, prev: RDD[_],
balanceSlack:
         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
future.
    
    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:
    https://github.com/scala/scala/blob/2.10.x/src/library/scala/collection/SeqLike.scala#L106
    
    
    



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message