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