Spark: Concatenating lists?

apache-spark, scala

Solution

`flatMap` that!

val rdd : org.apache.spark.rdd.RDD[List[Record]] = ???

val flattened = rdd.flatMap(identity)

Where `identity` is the identity function `f(x) => x`

Problem

How to concatenate all lists in: ``` org.apache.spark.rdd.RDD[List[Record]] ``` to get a single collection: ``` val values: org.apache.spark.rdd.RDD[Record] ``` Any ideas?

Original source