@@ -102,17 +102,11 @@ class VertexRDDSuite extends FunSuite with LocalSparkContext {
102
102
test(" mergeFunc" ) {
103
103
// test to see if the mergeFunc is working correctly
104
104
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 )))
112
106
val edges = EdgeRDD .fromEdges(sc.parallelize(List .empty[Edge [Int ]]))
113
107
val rdd = VertexRDD (verts, edges, 0 , (a : Int , b : Int ) => a + b)
114
108
// 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 )))
116
110
}
117
111
}
118
112
0 commit comments