How to extract 7z file on azure databricks

adf575076 6 Reputation points
2022-10-04T06:33:14.607+00:00

How to extract 7z file on azure databricks..

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,514 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bhargava-MSFT 31,261 Reputation points Microsoft Employee Moderator
    2022-10-06T21:21:24.197+00:00

    Hello @adf575076 ,

    Welcome to the MS Q&A platform.

    Please follow the below commands

    Ex: downloading the file from the URL https://resources.lendingclub.com/LoanStats3a.csv.zip to my tmp location

    import urllib   
    urllib.request.urlretrieve("https://resources.lendingclub.com/LoanStats3a.csv.zip", "/tmp/LoanStats3a.csv.zip")  
    

    unzip using the below commnad:

    %sh  
    unzip /tmp/LoanStats3a.csv.zip  
    

    You can see the file using the below command:

    %fs ls file:/databricks/driver/  
    

    248149-image.png

    Databricks document:

    https://docs.databricks.com/data/data-sources/zip-files.html

    ------------------------------

    If this answers your question, please consider accepting the answer by hitting the Accept answer button, as it helps the community.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.