cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Delete a file from GCS folder

MBV3
New Contributor III

What is the best way to delete files from the gcp bucket inside spark job?

1 REPLY 1

Unforgiven
Valued Contributor III

@M Baigโ€‹ 

yes you need just to create service account for databricks and than assign storage admin role to bucket. After that you can mount GCS standard way:

  1. bucket_name = "<bucket-name>"
  2. mount_name = "<mount-name>"
  3. dbutils.fs.mount("gs://%s" % bucket_name, "/mnt/%s" % mount_name)
  4. display(dbutils.fs.ls("/mnt/%s" % mount_name))

here link for ur refer before process, hope some info help on this case

https://docs.gcp.databricks.com/external-data/gcs.html

cheer

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group