Basic Map Reduce Operations

Now let us look into the basic map reduce operations such as Map, Filter, Reduce and Rich Collection API.

Problem Statement

Get Sum of squares all Even Numbers in a given range

val l = (1 to 100).toList
val f = l.filter(ele => ele % 2 == 0)
val m = f.map(rec => rec * rec)
var total =0
for( e <- m) total + = e

Share this post