How to rename my JSON generated by pyspark?
问题 When i write my JSON file with dataframe.coalesce(1).write.format('json') on pyspark im not able to change the name of file in the partition Im writing my JSON like that: dataframe.coalesce(1).write.format('json').mode('overwrite').save('path') but im not able to change the name of file in the partition I want the path like that: /folder/my_name.json where 'my_name.json' is a json file 回答1: In spark we can't control name of the file written to the directory. First write the data to the HDFS