Sure there is. Create a new RDD just containing the schema line (hint: use
sc.parallelize) and then union both the RDDs (the header RDD and data RDD)
to get a final desired RDD.

On Thu Jan 15 2015 at 19:48:52 Hafiz Mujadid <hafizmujadi...@gmail.com>
wrote:

> hi experts!
>
> I hav an RDD[String] and i want to add schema line at beginning in this
> rdd.
> I know RDD is immutable. So is there anyway to have a new rdd with one
> schema line and contents of previous rdd?
>
>
> Thanks
>
>
>
> --
> View this message in context: http://apache-spark-user-list.
> 1001560.n3.nabble.com/Inserting-an-element-in-RDD-String-tp21161.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