Forum Discussion

NiteshS's avatar
NiteshS
Helper I
2 years ago
Solved

Delta parquet format to JSON format

Dear Community,

 

I have my delta parquet table saved in Fabric Notebook. Is there a way to convert this to JSON file? Also, how can I access this JSON file locally on my system.

 

Thanks

Nitesh

  • Hi NiteshS 

     

    We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others.
    Otherwise, will respond back with the more details and we will try to help.

     

    Thanks

6 Replies

  • v-cboorla-msft's avatar
    v-cboorla-msft
    Microsoft Employee

    Hi NiteshS 

     

    Thanks for using Microsoft Fabric Community.

    As I understand that you want to convert a delta parquet table that is saved in Fabric Notebook to JSON file and also you want to access this JSON file locally on your system.

    I have tried the repro from our end and followed the below steps to achieve your ask.

    Step1: Reading the data from delta table.

    Step2: Converting the delta table to JSON by using the below mentioned code.

    delta_df = spark.read.format("delta").load("File Path")
    json_df = delta_df.write.format("json").save("File Path")
    

    Step3: Reading the data from JSON file.

    Please find the screenshot for the converted JSON file

    In order to access the JSON file on your local system, you can achieve this by installing One Lake explorer and sync with your workspace, you can download the JSON file into your local system from One Lake explorer. Screenshot attached for reference.

     

    I hope this information helps. Please do let us know if you have any further questions.

    • NiteshS's avatar
      NiteshS
      Helper I

      Thank you v-cboorla-msft. WIll try this out.

      • v-cboorla-msft's avatar
        v-cboorla-msft
        Microsoft Employee

        Hi NiteshS 

         

        We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others.
        Otherwise, will respond back with the more details and we will try to help.

         

        Thanks

  • JSON created is not in right format , we need the content as array to json.  

    {"id":"11", "name":"abc"} ,

    {"id":"12", "name":"xyz"} ,

    {"id":"11", "name":"abc"} 

     

    it is missing commas any ideas?