val spark:SparkSession = SparkSession.builder() .master("local[5]") .appName("SparkByExamples.com") .getOrCreate() val df = spark.range(0,20) println(df.rdd.partitions.length) df.write.mode(SaveMode.Overwrite)csv("partition.csv")