<?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 Read Json file in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/read-json-file/m-p/49651#M28600</link>
    <description>&lt;P&gt;I want to read json file. Code is shown as below&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;# credential_path =&lt;/SPAN&gt;&lt;SPAN&gt;"/dbfs/Workspace/Users/dhruval/Return-label/GCP_Credential.json"&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;credential_path = &lt;/SPAN&gt;&lt;SPAN&gt;"/Workspace/Users/dhruval/Return-label/GCP_Credential.json"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;credential = spark.read.&lt;/SPAN&gt;&lt;SPAN&gt;format&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"json"&lt;/SPAN&gt;&lt;SPAN&gt;).load(credential_path)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;Here, credential_path is copied by right clicking on the file. I have also tried with using "dbfs" as prefix. Thought it shows there is no such file.&lt;BR /&gt;&lt;BR /&gt;How to read that file&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 21 Oct 2023 08:30:30 GMT</pubDate>
    <dc:creator>dhruval</dc:creator>
    <dc:date>2023-10-21T08:30:30Z</dc:date>
    <item>
      <title>Read Json file</title>
      <link>https://community.databricks.com/t5/data-engineering/read-json-file/m-p/49651#M28600</link>
      <description>&lt;P&gt;I want to read json file. Code is shown as below&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;# credential_path =&lt;/SPAN&gt;&lt;SPAN&gt;"/dbfs/Workspace/Users/dhruval/Return-label/GCP_Credential.json"&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;credential_path = &lt;/SPAN&gt;&lt;SPAN&gt;"/Workspace/Users/dhruval/Return-label/GCP_Credential.json"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;credential = spark.read.&lt;/SPAN&gt;&lt;SPAN&gt;format&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"json"&lt;/SPAN&gt;&lt;SPAN&gt;).load(credential_path)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;Here, credential_path is copied by right clicking on the file. I have also tried with using "dbfs" as prefix. Thought it shows there is no such file.&lt;BR /&gt;&lt;BR /&gt;How to read that file&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 21 Oct 2023 08:30:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/read-json-file/m-p/49651#M28600</guid>
      <dc:creator>dhruval</dc:creator>
      <dc:date>2023-10-21T08:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Read Json file</title>
      <link>https://community.databricks.com/t5/data-engineering/read-json-file/m-p/49665#M28602</link>
      <description>&lt;P&gt;Hi Dhruval,&lt;/P&gt;&lt;P&gt;Did you try using the file: prefix to the path?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;credential = spark.read.&lt;/SPAN&gt;&lt;SPAN&gt;format&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"json"&lt;/SPAN&gt;&lt;SPAN&gt;).option(&lt;/SPAN&gt;&lt;SPAN&gt;"multiline"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"true"&lt;/SPAN&gt;&lt;SPAN&gt;).load(&lt;/SPAN&gt;&lt;SPAN&gt;"file:/Workspace/Users/dhruval/Return-label/GCP_Credential.json"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Note: Tested on 13.3 LTS cluster&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2023 22:30:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/read-json-file/m-p/49665#M28602</guid>
      <dc:creator>Krishnamatta</dc:creator>
      <dc:date>2023-10-21T22:30:41Z</dc:date>
    </item>
  </channel>
</rss>

