I have an existing Spark Dataset in my application. I used
Dataset<Row> dataframe = dataframe.withColumn(colName, new Column);
to update it. Now my last step is to write it to the Parquet file.
dataframe.write().mode(SaveMode.Append).parquet(getDSPath(dataset).toString());
When I use an Append mode it adds to the existing Dataset thus creating duplicated rows. If I use "SaveMode.Overwrite" then an exception is thrown :
File file:/share/data/applocation/spark/DATASETUAT/part-00000-3124c90f-461f-4c13-a5b2-25064de0ce59-c000.snappy.parquet does not exist
What can I do to Overwrite an existing Dataset?