title: Use from_json() in Scala to parse multiple Rows in a DataFrame
body: <p>I've a JSON within a Column of a Spark DataFrame as follows:</p>
  
  <pre><code>ID|           Text|           JSON
  ------------------------------------------------------------------------------
  1|             xyz|          [{"Hour": 1, "Total": 10, "Fail": 1}, {"Hour": 2, "Total": 40, "Fail": 4}, {"Hour": 3, "Total": 20, "Fail": 2}]
  </code></pre>
  
  <p>I'm using following Schema</p>
  
  <pre><code>val schema = StructType(Array(StructField("Hour", IntegerType),
     StructField("Total", IntegerType), StructField("Fail", IntegerType))
  </code></pre>
  
  <p>I'm using following code to parse the DataFrame and output the JSON as multiple columns</p>
  
  <pre><code>val newDF = DF.withColumn("JSON", from_json(col("JSON"), schema)).select(col("JSON.*"))
  newDF.show()
  </code></pre>
  
  <p>The above code just parses the one single record from the JSON. But, I want it to parse all the records in the JSON.</p>
  
  <p>The Output is as follows:</p>
  
  <pre><code>Hour|       Total|       Fail|
  -------------------------------
     1|          10|          1|
  -------------------------------
  </code></pre>
  
  <p>But, I want the output to be as follows:</p>
  
  <pre><code>Hour|       Total|       Fail|
  -------------------------------
     1|          10|          1|
     2|          40|          4|
     3|          20|          2|
  -------------------------------
  </code></pre>
  
  <p>Can Someone, please let me know. What is it that I'm missing !!</p>
  
  <p>Thanks in advance.</p>