From 581e9eef94cd906094f222d774fb61f5041fce84 Mon Sep 17 00:00:00 2001 From: Larry Xiao Date: Tue, 12 Aug 2014 16:37:59 +0800 Subject: [PATCH] TODO: VertexRDDSuite --- .../org/apache/spark/graphx/VertexRDDSuite.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/graphx/src/test/scala/org/apache/spark/graphx/VertexRDDSuite.scala b/graphx/src/test/scala/org/apache/spark/graphx/VertexRDDSuite.scala index cc86bafd2d644..39e62ea8edd9f 100644 --- a/graphx/src/test/scala/org/apache/spark/graphx/VertexRDDSuite.scala +++ b/graphx/src/test/scala/org/apache/spark/graphx/VertexRDDSuite.scala @@ -29,6 +29,10 @@ class VertexRDDSuite extends FunSuite with LocalSparkContext { VertexRDD(sc.parallelize((0 to n).map(x => (x.toLong, x)), 5)) } + def verticesDup(sc: SparkContext, n: Int) = { + VertexRDD(sc.parallelize((-n to n).map(x => (math.abs(x.toLong), x)), 5) + } + test("filter") { withSpark { sc => val n = 100 @@ -99,4 +103,14 @@ class VertexRDDSuite extends FunSuite with LocalSparkContext { } } + // TODO: + // need edges in apply function + test("apply.mergeFunc") { + withSpark { sc => + val n = 100 + val verts = vertices(sc, n) + val evens = verts.filter(q => ((q._2 % 2) == 0)) + assert(evens.count === (0 to n).filter(_ % 2 == 0).size) + } + } }