aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/test/scala/spark/RDDSuite.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/test/scala/spark/RDDSuite.scala b/core/src/test/scala/spark/RDDSuite.scala
index 9e73703371..3c1b387d16 100644
--- a/core/src/test/scala/spark/RDDSuite.scala
+++ b/core/src/test/scala/spark/RDDSuite.scala
@@ -175,6 +175,11 @@ class RDDSuite extends FunSuite with SharedSparkContext {
null)
}
test("cogrouped RDDs with locality") {
+ val data3 = sc.makeRDD(List((1,List("a","c")), (2,List("a","b","c")), (3,List("b"))))
+ val coalesced3 = data3.coalesce(3)
+ val list3 = coalesced3.partitions.map(p => p.asInstanceOf[CoalescedRDDPartition])
+ assert(list3.map(p => p.preferredLocation).length === 3, "Locality preferences are dropped")
+
// RDD with locality preferences spread (non-randomly) over 6 machines, m0 through m5
val data = sc.makeRDD((1 to 9).map(i => (i, (i to (i+2)).map{ j => "m" + (j%6)})))
val coalesced1 = data.coalesce(3)