I am writing spark dataframe to a csv using following options:
df .repartition("col1") .write .partitionBy("col1")