File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
graphx/src/test/scala/org/apache/spark/graphx Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ class VertexRDDSuite extends FunSuite with LocalSparkContext {
29
29
VertexRDD (sc.parallelize((0 to n).map(x => (x.toLong, x)), 5 ))
30
30
}
31
31
32
+ def verticesDup (sc : SparkContext , n : Int ) = {
33
+ VertexRDD (sc.parallelize((- n to n).map(x => (math.abs(x.toLong), x)), 5 )
34
+ }
35
+
32
36
test(" filter" ) {
33
37
withSpark { sc =>
34
38
val n = 100
@@ -99,4 +103,14 @@ class VertexRDDSuite extends FunSuite with LocalSparkContext {
99
103
}
100
104
}
101
105
106
+ // TODO:
107
+ // need edges in apply function
108
+ test(" apply.mergeFunc" ) {
109
+ withSpark { sc =>
110
+ val n = 100
111
+ val verts = vertices(sc, n)
112
+ val evens = verts.filter(q => ((q._2 % 2 ) == 0 ))
113
+ assert(evens.count === (0 to n).filter(_ % 2 == 0 ).size)
114
+ }
115
+ }
102
116
}
You can’t perform that action at this time.
0 commit comments