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: 

Move Files from S3 to Local File System with Unity Catalog Enabled

madhav_dhruve
New Contributor III

Dear Databricks Community Experts,

I am working on databricks on AWS with unity catalog.

One usecase for me is to uncompress files with many extensions there on S3 Bucket.

Below is my strategy:-

  1. Move files from S3 to Local file system (where spark driver is running) via dbutils.fs.mv(dbfs_file, local_file)
  2. Uncompress files via shell commands or packages in python
  3. Move back uncompressed files to S3 via dbutils

Here,

dbfs_file ==> s3://path_to_file or dbfs://path_to_file (I am using unit catalog and not mounting method)

local_file ==> file:///tmp/path_to_file,

When i use dbutils.fs.cp(dbfs_file, local_file), I am getting error as below - 

ERROR - java.lang.SecurityException: Cannot use com.databricks.backend.daemon.driver.WorkspaceLocalFileSystem - local filesystem access is forbidden

How to apply write permissions and resolve this issue.

Screenshot 2023-07-18 at 10.57.19 AM.png

 

1 REPLY 1

rvadali2
New Contributor II

did you find a solution to this?

 

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