Reputation: 1135
I am attempting to write a spark dataframe as JSON file; this will eventually be written out into MapR JSON DB table.
grp_small.toJSON.write.save("<path>")
This seems to write JSON file in snappy.parquet format. How do I force it to write it as a readable JSON (txt format) ?
Upvotes: 1
Views: 388
Reputation: 23119
You can write dataframe to json
which contains each row as readable json
in each line.
grp_small.write.json("path to output")
Hope this hepls!
Upvotes: 1