Saving the sorted data through spark

when top, or takeOrdered is used on RDDs it returns a list and saveAs options doesnt work on them

If the question is to save the top 5 working employees then how to achieve this.

You can pass the array to sc.parallelize which will generate RDD. It can be saved using saveAs*** API.