Skip to content

Commit

Permalink
Change basic sum scala example to match java one more closely
Browse files Browse the repository at this point in the history
  • Loading branch information
holdenk committed Mar 7, 2014
1 parent 658a08c commit 11f8779
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ object BasicSum {
}
val sc = new SparkContext(master, "BasicMap", System.getenv("SPARK_HOME"))
val input = sc.parallelize(List(1,2,3,4))
val squared = input.map(x => x*x)
val result = squared.fold(0)((x, y) => (x + y))
val result = input.fold(0)((x, y) => (x + y))
println(result)
}
}

0 comments on commit 11f8779

Please sign in to comment.