title: How to create Spark dataframe in Scala from Lists
body: <p>I have below lists,</p>
  <p>val col1 = List(1,2,3,4,5)</p>
  <p>val col2 = List(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;, &quot;e&quot;)</p>
  <p>val col3 = List(6,7,8)</p>
  <p>Requirement is to create a dataframe as below in Scala,</p>
  <pre><code>--------------------
  | col1 | col2| col3|
  --------------------
  |  1   |  a  |  6  |
  |  2   |  b  |  7  |
  |  3   |  c  |  8  |
  |  4   |  d  | null|
  |  5   |  e  | null|
  --------------------
  </code></pre>
  <p>Thank you.</p>