I have a pyspark script that will repeatedly be executed by airflow.
On each iteration, my script will load a dataframe from s3 location and update it.
However, when I try to update, it using
df.write.mode('overwrite').parquet(s3_url)
It completely wipes out the directory (deletes the directory). Am I misunderstanding the 'overwrite' mode ?
To put in short, I want to keep on overwriting to a certain s3 path without creating subfolders based on when I choose to run execute the script. When I tried to this with the code above, it deleted the existing directory.