Skip to content

Commit db54173

Browse files
DEBORAH SIEGELDEBORAH SIEGEL
authored andcommitted
fixed aggregateMessages example in graphX doc
1 parent 95ac68b commit db54173

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/graphx-programming-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ val graph: Graph[Int, Float] = ...
663663
def msgFun(triplet: Triplet[Int, Float]): Iterator[(Int, String)] = {
664664
Iterator((triplet.dstId, "Hi"))
665665
}
666-
def reduceFun(a: Int, b: Int): Int = a + b
666+
def reduceFun(a: String, b: String): String = a + " " + b
667667
val result = graph.mapReduceTriplets[String](msgFun, reduceFun)
668668
{% endhighlight %}
669669

@@ -674,7 +674,7 @@ val graph: Graph[Int, Float] = ...
674674
def msgFun(triplet: EdgeContext[Int, Float, String]) {
675675
triplet.sendToDst("Hi")
676676
}
677-
def reduceFun(a: Int, b: Int): Int = a + b
677+
def reduceFun(a: String, b: String): String = a + " " + b
678678
val result = graph.aggregateMessages[String](msgFun, reduceFun)
679679
{% endhighlight %}
680680

0 commit comments

Comments
 (0)