title: How to convert an RDD of Maps to dataframe
body: <p>I have RDD of Map and i want to converted it to dataframe 
  Here is the input format of RDD</p>
  
  <pre><code>val mapRDD: RDD[Map[String, String]] = sc.parallelize(Seq(
     Map("empid" -&gt; "12", "empName" -&gt; "Rohan", "depId" -&gt; "201"),
     Map("empid" -&gt; "13", "empName" -&gt; "Ross", "depId" -&gt; "201"),
     Map("empid" -&gt; "14", "empName" -&gt; "Richard", "depId" -&gt; "401"),
     Map("empid" -&gt; "15", "empName" -&gt; "Michale", "depId" -&gt; "501"),
     Map("empid" -&gt; "16", "empName" -&gt; "John", "depId" -&gt; "701")))
  </code></pre>
  
  <p>is there any way to convert into dataframe like</p>
  
  <pre><code> val df=mapRDD.toDf
  </code></pre>
  
  <p>df.show </p>
  
  <pre><code>empid,  empName,    depId
  12      Rohan       201
  13      Ross        201
  14      Richard     401
  15      Michale     501
  16      John        701
  </code></pre>