How to read multiple files (> 1000 files) and say only print out the first line for each file in spark?
I was reading the link How to read multiple text files into a single RDD? which mentioned I can read in multiple files (say 3 files) in spark using the following syntax:
val fs = sc.textFile("a.txt,b.txt,c.txt")
But fs
seems glue all the files together.