title: Splittling list of JSON key/value pairs into columns of a row in a Dataset
body: <p>I have a column with a list of key/value objects:</p>
  
  <pre class="lang-none prettyprint-override"><code>+----+--------------------------------------------------------------------------------------------+
  |ID  | Settings                                                                                   |
  +----+--------------------------------------------------------------------------------------------+
  |1   | [{"key":"key1","value":"val1"}, {"key":"key2","value":"val2"}, {"key":"key3","value":"val3"}] |
  +----+--------------------------------------------------------------------------------------------+
  </code></pre>
  
  <p>Is it possible to split this list of objects into its own row? 
  As such:</p>
  
  <pre class="lang-none prettyprint-override"><code>+----+------+-------+-------+
  |ID  | key1 | key2  |  key3 |
  +----+------+-------+-------+
  |1   | val1 | val2  |  val3 |
  +----+------+-------+-------+
  </code></pre>
  
  <p>I've tried exploding, and placing into a Struct:</p>
  
  <pre><code>   case class Setting(key: String, value: String)
     val newDF = df.withColumn("setting", explode($"settings"))
                  .select($"id", from_json($"setting" Encoders.product[Setting].schema) as 'settings)
  </code></pre>
  
  <p>which gives me:</p>
  
  <pre class="lang-none prettyprint-override"><code>+------+------------------------------+
  |ID    |settings                      |
  +------+------------------------------+
  |1     |[key1,val1]                   |
  |1     |[key2,val2]                   |
  |1     |[key3,val3]                   |
  +------+------------------------------+
  </code></pre>
  
  <p>And from here I can use the specifies rows by such settings.key
  But its not quite what I need. I need to access multiple keys in the one row of data</p>