title: How to flatten tuples in Spark?
body: <p>I'm looking to flatten an RDD of tuples (using a no-op map), but I'm getting a type error:</p>
  
  <pre><code>val fromTuples = sc.parallelize( List((1,"a"), (2, "b"), (3, "c")) )
  val flattened = fromTuples.flatMap(x =&gt; x)
  println(flattened.collect().toNiceString)
  </code></pre>
  
  <p>Gives</p>
  
  <blockquote>
    <p>error: type mismatch;</p>
    
    <p>found   : (Int, String)
     required: TraversableOnce[?]</p>
    
    <p>val flattened = fromMap.flatMap(x => x)</p>
  </blockquote>
  
  <p>The equivalent list of <code>List</code>s or <code>Array</code>s work fine, e.g.: </p>
  
  <pre><code>val fromList = sc.parallelize(List(List(1, 2), List(3, 4)))
  val flattened = fromList.flatMap(x =&gt; x)
  println(flattened.collect().toNiceString)
  </code></pre>
  
  <p>Can Scala handle this? If not, why not?</p>