title: What is the mkString equivalent in PySpark?
body: <p>I am converting a dataframe into a pipe separated values and writing it to a file in Spark shell (scala).  But I am clueless on the PySpark side. Would appreciate some help.</p>
  
  <p>Especially I dont know how to join each columns with a '|'</p>
  
  <p>Here is a scala version</p>
  
  <pre><code>scala&gt; val stgDF = spark.read.table("tbl")
  stgDF: org.apache.spark.sql.DataFrame = [name: string, num: int]
  
  scala&gt; stgDF.map(line =&gt; line.mkString("|")).take(2) //How do I do in PySpark?
  res0: Array[String] = Array(spark|2001, yarn|2002)
  
  scala&gt; val tmp = stgDF.map(line =&gt; line.mkString("|")).rdd
  tmp: org.apache.spark.rdd.RDD[String] = MapPartitionsRDD[20] at rdd at &lt;console&gt;:25
  
  scala&gt; tmp.saveAsTextFile("stgDF")
  </code></pre>