scala sample code for spark