title: Spark RDD[(String, String)] into RDD[Map[String, String]]
body: <p>Is there any way to collect all <code>RDD[(String, String)]</code> into one <code>RDD[Map[String, String]]</code>?</p>
  
  <p>E.g., for file <code>input.csv</code>:</p>
  
  <pre><code>1,one
  2,two
  3,three
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>val file = sc.textFile("input.csv")
  val pairs = file.map(line =&gt; { val a = line.split(","); (a(0), a(1)) })
  val rddMap = ???
  </code></pre>
  
  <p>Output (approximate):</p>
  
  <pre><code>val map = rddMap.collect
  map: Array[scala.collection.immutable.Map[String,String]] = Array(Map(1 -&gt; one, 2 -&gt; two, 3 -&gt; three))
  </code></pre>
  
  <p>Tried <code>pairs.collectAsMap</code> but it returns <code>Map</code> not inside <code>RDD</code>.</p>