Full code review

Full code review
Why can't you just read the stop-words file in the driver program as an array and then use it inside a (read only) broadcast variable? http://spark.apache.org/docs/latest/programming-guide.html#broadcast-variables

Broadcast variables are used to cache a value in memory on all nodes. Probably you have to copy the stop-words file with the code on each node, but it will be read just once per node, so it doesn't matter how many mappers you will have in the end.