Delete Folder in DBFS

Viewed 903

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

1 Answers

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.

Related