If the goal is to sum the elements of the value (Int, Int), then transforming the map can achieve this:
val arr = Array(("A", (1, 1)), ("B", (2, 2)), ("C", (3, 3))
val rdd = sc.parallelize(arr)
val result = rdd.map{ case (a, (b, c)) => (a, b + c) }
Instead, if the value type is an array, Array.sum can be used.
val rdd = sc.parallelize(Array(("A", Array(1, 1)),
("B", Array(2, 2)),
("C", Array(3, 3)))
rdd.map { case (a, b) => (a, b.sum) }
Edit:
mapthe conversion does not preserve the original delimiter, as @Justin suggested mapValuesmight be more appropriate here:
rdd.mapValues{ case (x, y) => x + y }
rdd.mapValues(_.sum)