I want to understand how spark determines the number of csv files it creates while saving a data frame as csv file. Does the number of partitions affect this number? and why are some empty files created? I have the code like follows
dataframe.coalesce(numPartitions).write
.format("com.databricks.spark.csv")
.option("delimiter", "|")
.option("header", "true")
.mode("overwrite")
.save("outputpath")