Search code examples
pythonapache-sparkparquet

How to delete a Parquet file on Spark?


I have saved a parquet file on Spark using DataFrame.saveAsParquet() command.

How can I delete/remove this file via python code?


Solution

  • 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')