title: Spark RDD map internal object to Row
body: <p>My initial data from a CSV file is:</p>
  
  <pre><code>1 ,21658392713 ,21626890421 
  1 ,21623461747 ,21626890421 
  1 ,21623461747 ,21626890421 
  </code></pre>
  
  <p>The data I have after a few transformations and grouping based on business logic is yields </p>
  
  <pre><code>scala&gt; val sGrouped = grouped
  sGrouped: org.apache.spark.rdd.RDD[(String, Iterable[(String,    
  (Array[String], String))])] = ShuffledRDD[85] at groupBy at &lt;console&gt;:51
  
  scala&gt; sGrouped.foreach(f=&gt;println(f))
  (21626890421,CompactBuffer((21626890421, 
               ([Ljava.lang.String;@62ac8444,21626890421)), 
               (21626890421,([Ljava.lang.String;@59d80fe,21626890421)),       
               (21626890421,([Ljava.lang.String;@270042e8,21626890421)), 
  </code></pre>
  
  <p>from this I want to get a map that yields something like the following format</p>
  
  <pre><code>[String, Row[String]] 
  </code></pre>
  
  <p>so the data may look like:</p>
  
  <pre><code>[ 21626890421 , Row[(1 ,21658392713 ,21626890421)
                , (1 ,21623461747 ,21626890421)
                ,  (1 ,21623461747,21626890421)]]
  </code></pre>
  
  <p>I really appreciate any guidance on moving forward on this.</p>