scala 写csv文件
val rdd=sc.parallelize(List(("Jack","America","23"),("Mark","China","25"),("Lura","Australia","24")))
import sqlContext.implicits._
val df=rdd.repartition(1).toDF("name","country","age")//写文件的个数为repartition数
df.write.option("header",true).option("encoding", "UTF-8").csv("C:\\Users\\peanut\\Desktop\\myStudent")