How to extract 7z file on azure databricks

adf575076 1 Reputation point
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,080 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bhargava-MSFT 29,266 Reputation points Microsoft Employee
    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.