title: Can reduceBykey be used to change type and combine values - Scala Spark?
body: <p>In code below I'm attempting to combine values: </p>
  
  <pre><code>val rdd: org.apache.spark.rdd.RDD[((String), Double)] =
      sc.parallelize(List(
        (("a"), 1.0),
        (("a"), 3.0),
        (("a"), 2.0)
        ))
  
  val reduceByKey = rdd.reduceByKey((a , b) =&gt; String.valueOf(a) + String.valueOf(b))
  </code></pre>
  
  <p><code>reduceByValue</code> should contain (a , 1,3,2) but receive compile time error : </p>
  
  <pre><code>Multiple markers at this line - type mismatch; found : String required: Double - type mismatch; found : String 
   required: Double
  </code></pre>
  
  <p>What determines the type of the reduce function? Can the type not be converted?</p>
  
  <p>I could use <code>groupByKey</code> to achieve same result but just want to understand <code>reduceByKey</code>.</p>