Hi,

I guess you would like to remove the header of a CSV file.

You can play with partitions. =)

// src is your RDD
val noHeader = src.mapPartitionsWithIndex(
(i, iterator) =>
    if (i == 0 && iterator.hasNext) {
       iterator.next
       iterator
    } else iterator)

Thus, you don't need to filter on the whole RDD. Good luck.

Hao



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/removing-first-record-from-RDD-String-tp20834p20836.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to