July 2018
Intermediate to advanced
334 pages
8h 20m
English
Invoke a flatMap operation over the result1 RDD, and split each partition around its "\n" (end of the line) character as follows:
scala> val result2 = result1.flatMap{ partition => partition.split("\n").toList }result2: org.apache.spark.rdd.RDD[String] = MapPartitionsRDD[2] at flatMap at <console>:27
Each partition is after a string. In the next step, we will transform the result2 RDD.
Read now
Unlock full access