January 2019
Beginner to intermediate
154 pages
4h 31m
English
The reduce() action combines the RDD elements in parallel and gives aggregated results as output. In the following example, we calculate the sum of the first 10 natural numbers:
//Scalaspark.sparkContext.parallelize(1 to 10).reduce( _ + _ )res1: Int = 55
Read now
Unlock full access