How to delete a Parquet file on Spark?
13,559
This parquet "file" will actually be a directory. This answer shows how to delete a directory with files in it
import shutil
shutil.rmtree('/folder_name')
Author by
Admin
Updated on August 21, 2022Comments
-
Admin over 1 year
I have saved a parquet file on Spark using
DataFrame.saveAsParquet()
command.How can I delete/remove this file via python code?
-
Admin almost 8 yearsIt works without the forward slash. shutil.rmtree('folder_name')
-
bsplosion over 4 yearsNote that this only works on the OS and is not applicable on HDFS, S3, or myriad other common locations for Parquet files being used in Spark.