title: Save dataframe as JSON in specific structure in Spark Scala
body: <p>I have a <code>dataframe</code> df which can be saved as <code>json</code> file in the following structure: <code>{"id":"1234567890","score":123.0,"date":yyyymmdd}</code></p>
  
  <p>for first instance I am saving it as follows:</p>
  
  <pre><code>df.write.format("json").save("path")
  </code></pre>
  
  <p>This df needs to saved as <code>json</code> file in the following structure <code>id::1234567890\t{"id":"1234567890","score":123.0,"date":yyyymmdd}</code></p>
  
  <p>I tried various ways but couldn't do it. How can we save it in the desired format?</p>
  
  <pre><code>Spark version: 1.6.0
  Scala version: 2.10.6
  </code></pre>