Hi,

I'm trying to find a way to create a csv header when using saveAsTextFile,
and I came up with this:

(sc.makeRDD(Array("col1,col2,col3"), 1) ++
myRdd.coalesce(1).map(_.mkString(",")))
      .saveAsTextFile("out.csv")

But it only saves the header part. Why is that the union method does not
return both RDD's?

Reply via email to