I want to groupby a certain column in a Pyspark dataframe and output each group into a file. I do the following:
df.repartition(\'user_group\').write.partitionBy(