Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 01:37 AM
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