cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Unzip Files

Ajay-Pandey
Esteemed Contributor III

Hi all, I am trying to unzip a file in databricks but facing an issue,

Please help me if you have any doc or codes to share.

1 ACCEPTED SOLUTION

Accepted Solutions

vivek_rawat
New Contributor III

Hey ajay,

You can follow this module to unzip your zip file.

To give your brief idea about this, it will unzip your file directly into your driver node storage.

So If your compressed data is inside DBFS then you first have to move that to drive node and then uncompress that using the following and again move that uncompressed data to DBFS.( dbutils.fs.cp for moving between driver and dbfs)

import subprocess
subprocess.Popen(f'unzip {file_name}.zip', shell=True)

View solution in original post

7 REPLIES 7

Hubert-Dudek
Esteemed Contributor III

Is it community edition or a commercial one?

Ajay-Pandey
Esteemed Contributor III

It's commercial

Hubert-Dudek
Esteemed Contributor III

bur generally try that library to unzip

import zipfile

Ajay-Pandey
Esteemed Contributor III

Thanks, will try

vivek_rawat
New Contributor III

Hey ajay,

You can follow this module to unzip your zip file.

To give your brief idea about this, it will unzip your file directly into your driver node storage.

So If your compressed data is inside DBFS then you first have to move that to drive node and then uncompress that using the following and again move that uncompressed data to DBFS.( dbutils.fs.cp for moving between driver and dbfs)

import subprocess
subprocess.Popen(f'unzip {file_name}.zip', shell=True)

Ajay-Pandey
Esteemed Contributor III

Thanks @Vivek Rawat​ it's worked.

Thank you sir, I will try it.

Thank you sir, I will try it. I discovered a valuable resource look these up by choose the greatest essay writing service, this website offers in-depth reviews of a number of them.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.