user1124702
user1124702

Reputation: 1135

Writing spark dataframe to ascii JSON

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

Answers (1)

koiralo
koiralo

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

Related Questions