Skip to content
Advertisement

Delete Folder in DBFS

I want to delete all the folders from my path

dbfs:/databricks-results/

When I try :

dbutils.fs.rm('dbfs:/databricks-results/', True) 

I get SQL Parse Exception

How do I solve this

Advertisement

Answer

It looks like your notebook has SQL as primary language, but you’re trying to use the Python code. Change your cell to:

%python
dbutils.fs.rm('dbfs:/databricks-results/', True)

P.S. You can omit dbfs: – it’s used by default.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement