Repository: spark
Updated Branches:
  refs/heads/master 9ce12aaf2 -> e7d8ae444


aggregateMessages example in graphX doc

Examples illustrating difference between legacy mapReduceTriplets usage and 
aggregateMessages usage has type issues on the reduce for both operators.

Being just an example-  changed example to reduce the message String by 
concatenation. Although non-optimal for performance.

Author: DEBORAH SIEGEL <[email protected]>

Closes #4853 from d3borah/master and squashes the following commits:

db54173 [DEBORAH SIEGEL] fixed aggregateMessages example in graphX doc


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e7d8ae44
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e7d8ae44
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e7d8ae44

Branch: refs/heads/master
Commit: e7d8ae444fead27fe85a879f2f7a4cfdd8c47b16
Parents: 9ce12aa
Author: DEBORAH SIEGEL <[email protected]>
Authored: Mon Mar 2 10:15:32 2015 -0800
Committer: Reynold Xin <[email protected]>
Committed: Mon Mar 2 10:15:32 2015 -0800

----------------------------------------------------------------------
 docs/graphx-programming-guide.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/e7d8ae44/docs/graphx-programming-guide.md
----------------------------------------------------------------------
diff --git a/docs/graphx-programming-guide.md b/docs/graphx-programming-guide.md
index 28bdf81..c601d79 100644
--- a/docs/graphx-programming-guide.md
+++ b/docs/graphx-programming-guide.md
@@ -663,7 +663,7 @@ val graph: Graph[Int, Float] = ...
 def msgFun(triplet: Triplet[Int, Float]): Iterator[(Int, String)] = {
   Iterator((triplet.dstId, "Hi"))
 }
-def reduceFun(a: Int, b: Int): Int = a + b
+def reduceFun(a: String, b: String): String = a + " " + b
 val result = graph.mapReduceTriplets[String](msgFun, reduceFun)
 {% endhighlight %}
 
@@ -674,7 +674,7 @@ val graph: Graph[Int, Float] = ...
 def msgFun(triplet: EdgeContext[Int, Float, String]) {
   triplet.sendToDst("Hi")
 }
-def reduceFun(a: Int, b: Int): Int = a + b
+def reduceFun(a: String, b: String): String = a + " " + b
 val result = graph.aggregateMessages[String](msgFun, reduceFun)
 {% endhighlight %}
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to