I have a dataframe like below:
+---+-----+-------------------+
| x| y| z|
+---+-----+-------------------+
|xyz|12223|A,123@B,456@C,98765|
|abc|12456| A,123|
+---+-----+-------------------+
I save it as csv:
index.write.csv("D:\\spark\\tmp\\dd2")
two issues here:
- Would you like tell me how to save the column name x,y,z to the header of csv please?
- How can I save the output to a single file please?