Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete record from databricks DBFS

I am trying to delete some records in Databricks Delta Lake that is located in DBFS. I only have path . Not saved as a table, is there any way to delete record from delta files?

Thank you

like image 225
FATMA BERRAK GUNGOR Avatar asked Oct 18 '25 09:10

FATMA BERRAK GUNGOR


1 Answers

Updated answer:

Delta Lake is able to perform deletes using the DELETE FROM command, so you just need to come with correct WHERE condition to match your record that you want to remove (put the real path instead of <path-to-delta-table>):

DELETE FROM delta.`<path-to-delta-table>` WHERE your_condition

First version of answer, before update:

DBFS is the file system, and items on it are files & directories. You can remove files & directories either using %fs rm file_name (docs), or corresponding dbutils.fs.rm("file_name") command in Python or Scala (see docs). You can even do it via Databricks CLI, directly from your computer or via REST API.

Another object in DBFS is a mount point, for which there are special commands. You can unmount mount point if necessary

like image 193
Alex Ott Avatar answered Oct 22 '25 05:10

Alex Ott



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!