SailajaB
Databricks Partner

Hi Melbourne,

Thank you for the reply

We are using below code to convert to JSON

df.coalesce(1).write.format("json").save(dataLocation)

We are receiving in the o/p as below

{"col1":"A","col2":"B"}

{"col1":"C","col2":"D"}

We are excepting in JSON format as below

[{"col1":"A","col2":"B"},

{"col1":"C","col2":"D"}]

Thank you