cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Convert pkl file

Innov
New Contributor

I am looking to convert pkl file to parquet format. I am reading this data from Azure Data Lake and convert and create parquet file outputs to store them in my hive metastore.  

1 REPLY 1

Kaniz_Fatma
Community Manager
Community Manager

Hi @InnovTo convert a Pickle (pkl) file to Parquet format and store it in your Azure data lake, you can follow these steps:

  1. Azure Data Factory:

  2. Databricks:

    • In Databricks, you can save a DataFrame as a Parquet file in Azure Data Lake. For example:
      save_location = "/mnt/adls/covid/base/Covid19_Cases" + year
      parquet_location = save_location + "temp.folder"
      file_location = save_location + "export.parquet"
      
      df.repartition(1).write.parquet(path=parquet_location, mode="append", header="true")
      
      file = dbutils.fs.ls(parquet_location)[-1].path
      dbutils.fs.cp(file, file_location)
      dbutils.fs.rm(parquet_location, recurse=True)
      
    • Adjust the save_location, parquet_location, and file_location according to your use case2.
  3. Azure Data Lake Analytics (ADLA):

  4. Azure Databricks Delta Lake:

Remember to adjust the code snippets according to your specific requirements and environment. Happy data processing! ๐Ÿš€๐Ÿ”

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!