I am completely new to spark and scala.
I want to read a file into an array list.
This is how its done in java.
List<String> sourceRecords;
sourceRecords = new ArrayList<String>();
BufferedReader SW;
SW = new BufferedReader(new FileReader(srcpath[0].toString()));
String srcline ;
while ((srcline = SW.readLine()) != null) {
sourceRecords.add(srcline.toString());
}
How to do it in scala in spark