title: How createCombiner,mergeValue, mergeCombiner works in CombineByKey in Spark ( Using Scala)
body: <p>I am trying to understand how each step in <code>combineByKeys</code> works.</p>
  
  <p>Can someone please help me understand the same for the below RDD?</p>
  
  <pre><code>val rdd = sc.parallelize(List(
    ("A", 3), ("A", 9), ("A", 12), ("A", 0), ("A", 5),("B", 4), 
    ("B", 10), ("B", 11), ("B", 20), ("B", 25),("C", 32), ("C", 91),
     ("C", 122), ("C", 3), ("C", 55)), 2)
  
  rdd.combineByKey(
      (x:Int) =&gt; (x, 1),
      (acc:(Int, Int), x) =&gt; (acc._1 + x, acc._2 + 1),
      (acc1:(Int, Int), acc2:(Int, Int)) =&gt; (acc1._1 + acc2._1, acc1._2 + acc2._2))
  </code></pre>