I want to append the table metrics
in an existing CSV file. I use the code below:
metrics.coalesce(1)
.write
.option("header", "true")
.option("sep",",")
.mode("Append")
.csv("data/outputs.csv}")
Every time the block of code below runs, a new file .part-00000-{xxxxxx-xxxxx......}.csv
is created in data/outputs.csv (where outputs.csv is a folder instead of a CSV file).
Is there any way to always append the table in the same CSV file and not creating a new .csv file? and any way to define the final name of this CSV, instead of using the .part-00000-{xxxxxx-xxxxx......}.csv
format?
I tried with the save mode append option (.mode(SaveMode.Append)
) with the same duplication result.