<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Volumes unzip files in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/volumes-unzip-files/m-p/103334#M41404</link>
    <description>&lt;P&gt;Thank you for your question! Have you tried using a cluster init script to install p7zip automatically when the cluster starts? This avoids the need for sudo during your session.&lt;BR /&gt;Alternatively, if unzip is already available, you can modify your script like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;%sh
for file in /dbfs/mnt/zip/$source/*.zip
do
  unzip -P "$pw" "$file" -d /dbfs/mnt/zip/$source/unzipped/
done&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 27 Dec 2024 17:53:15 GMT</pubDate>
    <dc:creator>VZLA</dc:creator>
    <dc:date>2024-12-27T17:53:15Z</dc:date>
    <item>
      <title>Volumes unzip files</title>
      <link>https://community.databricks.com/t5/data-engineering/volumes-unzip-files/m-p/86860#M37348</link>
      <description>&lt;P&gt;I have this shell unzip that I use to unzip files&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;%sh&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;sudo apt-get update&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;sudo apt-get install -y p7zip-full&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;But when it comes to new workspace, I get error&amp;nbsp;&lt;BR /&gt;sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required Reading package lists... E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) E: Unable to lock directory /var/lib/apt/lists/ E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root? bash: line 7: 7z: command not foundHow could I unzip files with volumes, If I already have them there ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;should I make a shell init script to do that or how ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The files are password protected&amp;nbsp;&lt;BR /&gt;The unzip that worked&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;%sh for file in /dbfs/mnt/zip/$source/*.zip do 7z x "$file" -p$pw -o/dbfs/mnt/zip/$source/unzipped/ -y done&lt;BR /&gt;Any good ideas welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 13:18:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/volumes-unzip-files/m-p/86860#M37348</guid>
      <dc:creator>vannipart</dc:creator>
      <dc:date>2024-08-30T13:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Volumes unzip files</title>
      <link>https://community.databricks.com/t5/data-engineering/volumes-unzip-files/m-p/103334#M41404</link>
      <description>&lt;P&gt;Thank you for your question! Have you tried using a cluster init script to install p7zip automatically when the cluster starts? This avoids the need for sudo during your session.&lt;BR /&gt;Alternatively, if unzip is already available, you can modify your script like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;%sh
for file in /dbfs/mnt/zip/$source/*.zip
do
  unzip -P "$pw" "$file" -d /dbfs/mnt/zip/$source/unzipped/
done&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 27 Dec 2024 17:53:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/volumes-unzip-files/m-p/103334#M41404</guid>
      <dc:creator>VZLA</dc:creator>
      <dc:date>2024-12-27T17:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Volumes unzip files</title>
      <link>https://community.databricks.com/t5/data-engineering/volumes-unzip-files/m-p/103374#M41421</link>
      <description>&lt;P&gt;First, you can read the ZIP file in a binary format [&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;spark.read.&lt;/SPAN&gt;&lt;SPAN&gt;format&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"binaryFile"&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;], then use the &lt;STRONG&gt;zipfile&lt;/STRONG&gt; Python package to unzip and extract all the files from the zipped file and store them in a Volume.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Dec 2024 04:12:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/volumes-unzip-files/m-p/103374#M41421</guid>
      <dc:creator>karthickrs</dc:creator>
      <dc:date>2024-12-28T04:12:24Z</dc:date>
    </item>
  </channel>
</rss>

