O'Reilly logo
  • CHIA-MING LIN thinks this is interesting:

(acc: (Int, Int), v) => (acc._1 + v, acc._2 + 1)

From

Cover of Learning Spark

Note

mergeValue: for a exiting key found, update the corresponding accumulator.