collection.map (_._ 2) emits the second component of the tuple. An example from pure Scala (Spark RDD work the same):
scala> val zipped = (1 to 10).zip('a' to 'j') zipped: scala.collection.immutable.IndexedSeq[(Int, Char)] = Vector((1,a), (2,b), (3,c), (4,d), (5,e), (6,f), (7,g), (8,h), (9,i), (10,j)) scala> val justLetters = zipped.map(_._2) justLetters: scala.collection.immutable.IndexedSeq[Char] = Vector(a, b, c, d, e, f, g, h, i, j)
marekinfo
source share