Press "Enter" to skip to content

Map and FlatMap in Spark

The Hadoop in Real World team maps some knowledge:

Let’s look at map() first. map() transforms and RDD with N elements to RDD with N elements. Important thing to note is each element is transformed into another element there by the resultant RDD will have the same elements as before.

Click through to see how map() and flatMap() differ.