title: Changing key during reduce phase
body: <p>Let's say my (key,value) pairs are now these:</p>
  
  <pre><code>(word1,d1=1)
  (word1,d2=1)
  (word2,d1=2)
  (word3,d1=1)
  </code></pre>
  
  <p>Is it possible to reduce to the following where the key is changed and the value is original number/number of times it appears?</p>
  
  <pre><code>(word1@d1, 1/2)
  (word1@d2, 1/2)
  (word2@d1, 2/1)
  (word3@d1, 1/1)
  </code></pre>
  
  <p>I read the docs from Spark. The reduceByKey() will return me a dataset of (K, V) where V1,V2 -> V and the key would remain K. But in the above case, K will be K' and I have to update the V for different keys. Any ways I can achieve the above? Just started learning Spark and I'm confused now. Appreciate your help!!</p>