Skip to content
Snippets Groups Projects
Commit aa24b0bb authored by Ankur Dave's avatar Ankur Dave
Browse files

Add test for mapReduceTriplets in GraphSuite

parent bf4e45e6
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,18 @@ class GraphSuite extends FunSuite with LocalSparkContext {
}
}
test("mapReduceTriplets") {
withSpark(new SparkContext("local", "test")) { sc =>
val n = 3
val star = Graph(sc.parallelize((1 to n).map(x => (0: Vid, x: Vid))))
val neighborDegreeSums = star.mapReduceTriplets(
edge => Array((edge.srcId, edge.dstAttr), (edge.dstId, edge.srcAttr)),
(a: Int, b: Int) => a + b)
assert(neighborDegreeSums.collect().toSet === (0 to n).map(x => (x, n)).toSet)
}
}
test("aggregateNeighbors") {
withSpark(new SparkContext("local", "test")) { sc =>
val n = 3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment