Here is the code that I am using to write dataframe to JSON. I am running this code from zeppelin:
val df = Seq((2012, 8, "Batman", 9.8), (2012, 8, "Hero", 8.7), (2012, 7, "Robot", 5.5), (2011, 7, "Git", 2.0)).toDF("year", "month", "title", "rating")
df.write.json("/tmp/out.json")
What I expect is dataframe data written in /tmp/out.json file. However it is creating directory with name "/tmp/out.json" and inside that I find following two files:
_SUCCESS
._SUCCESS.crc
None of these file is having JSON data. What am I missing here?