Skip to content

Commit e4ca697

Browse files
committed
[TEST] VertexRDD.apply mergeFunc
1 parent 6a35ea8 commit e4ca697

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,11 @@ class VertexRDDSuite extends FunSuite with LocalSparkContext {
102102
test("mergeFunc") {
103103
// test to see if the mergeFunc is working correctly
104104
withSpark { sc =>
105-
// VertexRDD default constructor: Duplicate entries are removed arbitrarily.
106-
// val verts = VertexRDD(sc.parallelize(List((0L, 1), (0L, 2), (1L, 3), (1L, 3), (1L, 3))))
107-
// ensure constructor preserve duplicate vertex
108-
// assert(verts.collect.toSet == Set((0L, 1), (0L, 2), (1L, 3), (1L, 3), (1L, 3)))
109-
// won't pass
110-
111-
val verts = sc.parallelize(List((0L, 1), (0L, 2), (1L, 3), (1L, 3), (1L, 3)))
105+
val verts = sc.parallelize(List((0L, 0), (1L, 1), (1L, 2), (2L, 3), (2L, 3), (2L, 3)))
112106
val edges = EdgeRDD.fromEdges(sc.parallelize(List.empty[Edge[Int]]))
113107
val rdd = VertexRDD(verts, edges, 0, (a: Int, b: Int) => a + b)
114108
// test merge function
115-
assert(rdd.collect.toSet == Set((0L, 3), (1L, 9)))
109+
assert(rdd.collect.toSet == Set((0L, 0), (1L, 3), (2L, 9)))
116110
}
117111
}
118112

0 commit comments

Comments
 (0)