[apache-spark] What is the difference between map and flatMap and a good use case for each?