Skip to content

Commit 66818b9

Browse files
author
Brennon York
committed
added small secondary diff test
1 parent 99ad412 commit 66818b9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

graphx/src/test/scala/org/apache/spark/graphx/VertexRDDSuite.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ class VertexRDDSuite extends FunSuite with LocalSparkContext {
5858
}
5959
}
6060

61+
test("diff functionality with small concrete values") {
62+
withSpark { sc =>
63+
val setA: VertexRDD[Int] = VertexRDD(sc.parallelize(0L until 2L).map(id => (id, id.toInt)))
64+
// setA := Set((0L, 0), (1L, 1))
65+
val setB: VertexRDD[Int] = VertexRDD(sc.parallelize(1L until 3L).map(id => (id, id.toInt+2)))
66+
// setB := Set((1L, 3), (2L, 4))
67+
val diff = setA.diff(setB)
68+
assert(diff.collect.toSet == Set((2L, 4)))
69+
}
70+
}
71+
6172
test("leftJoin") {
6273
withSpark { sc =>
6374
val n = 100

0 commit comments

Comments
 (0)