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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]