I am trying to write to a text file after applying the map, reduce operations. The below code is creating 8 files, but I need only one file
df3.rdd.map(_.toSeq.map(_+"").reduce(_+" "+_)).saveAsTextFile("/home/ram/Desktop/test4")
Please suggest how to write content to a single file