Explode Spark Dataframe column containing JSON
<p>I have a column in a dataframe that contains a JSON object. For each row in my dataframe, I'd like to extract the JSON, parse it and pull out certain fields. Once extracted, I'd like to append the fields to the row as new column elements.</p>

<p>I've looked at the <code>explode()</code> methods available on DataFrame as well as <code>foreach()</code>, <code>flatMap()</code> and <code>map()</code>, but have not been able to discern which is more appropriate for this type of processing.</p>