In my project, I have three input files and make the file names as args (0) in args (2), I also have the name of the output file as args (3), in the source code I use
val sc = new SparkContext() var log = sc.textFile(args(0)) for(i <- 1 until args.size - 1) log = log.union(sc.textFile(args(i)))
I do nothing for the log, but save it as a text file with
log.coalesce(1, true).saveAsTextFile(args(args.size - 1))
but it is still saved in 3 files as part-00000, part-00001, part-00002. So can I save the three input files to the output file?
source share