Apache Spark - Key Value RDD

7 / 28

What would the following code do?

var inputdata = List((1,2),(1,13),(1,4), (1, 6))
var kvrdd = sc.parallelize(inputdata)
def max(a:Int, b:Int): Int = {
    if(a > b) return a;
    return b
}
val out = kvrdd.reduceByKey(max)
out.collect()