Json format write


#1

When asked to write output json format in exam what needs to follow ?
df.write.format(“json”) or
df.toJSON.saveAsTextFile()