I tried to merge two files in a Datalake using scala in data bricks and saved it back to the Datalake using the following code:
val df =sqlContext.read.format("com.databricks.spark.csv").option("header", "true").option("inferSchema", "true").load("adl://xxxxxxxx/Test/CSV")
df.coalesce(1).write.
format("com.databricks.spark.csv").
mode("overwrite").
option("header", "true").
save("adl://xxxxxxxx/Test/CSV/final_data.csv")
However the file final_data.csv is saved as a directory instead of a file with multiple files and the actual .csv file is saved as 'part-00000-tid-dddddddddd-xxxxxxxxxx.csv'.
How do I rename this file so that I can move it to another directory?