I am trying to write a file to hdfs using spark-submit. When writing a file, I want to split one file into several, like the result of mapreduce rather than one.(ex. part-0000, park-0001)
here is sample code What options should I set
val conf = new Configuration()
val fs= FileSystem.get(conf)
val output = fs.create(new Path("/user/foo/test.txt"))
val writer = new PrintWriter(output)
writer.write("Hellow World1\n")
writer.write("Hellow World2\n")
...
writer.write("Hellow World3\n")