Added a sample using the mapPartitions function