title: Convert Nested JSON into a DataFrame using Spark/Scala
body: <p>I have a nested JSON where I need to convert into flattened DataFrame without defining or exploding any column names in it.</p>
  
  <pre class="lang-scala prettyprint-override"><code>val df = sqlCtx.read.option("multiLine",true).json("test.json")
  </code></pre>
  
  <p>So this is how my data looks like  :</p>
  
  <pre><code>[
    {
      "symbol": “TEST3",
      "timestamp": "2019-05-07 16:00:00",
      "priceData": {
        "open": "1177.2600",
        "high": "1179.5500",
        "low": "1176.6700",
        "close": "1179.5500",
        "volume": "49478"
      }
    },
    {
      "symbol": “TEST4",
      "timestamp": "2019-05-07 16:00:00",
      "priceData": {
        "open": "189.5660",
        "high": "189.9100",
        "low": "189.5100",
        "close": "189.9100",
        "volume": "267986"
      }
    }
  ]
  </code></pre>