<?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 Re: You have json file which is nested with multiple key value pair how you read it in databricks? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/you-have-json-file-which-is-nested-with-multiple-key-value-pair/m-p/58691#M31241</link>
    <description>&lt;P&gt;You should be able to read the json file with below code.&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="kd"&gt;val&lt;/SPAN&gt; &lt;SPAN class="n"&gt;df&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;spark&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;read&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;format&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"json"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;).&lt;/SPAN&gt;&lt;SPAN class="n"&gt;load&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"file.json"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;After this you will need to use the explode function to add columns to the dataframe using the nested values.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jan 2024 11:46:10 GMT</pubDate>
    <dc:creator>Lakshay</dc:creator>
    <dc:date>2024-01-30T11:46:10Z</dc:date>
    <item>
      <title>You have json file which is nested with multiple key value pair how you read it in databricks?</title>
      <link>https://community.databricks.com/t5/data-engineering/you-have-json-file-which-is-nested-with-multiple-key-value-pair/m-p/58650#M31229</link>
      <description>&lt;P&gt;&lt;SPAN&gt;You have json file which is nested with multiple key value pair how you read it in databricks?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 06:31:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/you-have-json-file-which-is-nested-with-multiple-key-value-pair/m-p/58650#M31229</guid>
      <dc:creator>learning_1989</dc:creator>
      <dc:date>2024-01-30T06:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: You have json file which is nested with multiple key value pair how you read it in databricks?</title>
      <link>https://community.databricks.com/t5/data-engineering/you-have-json-file-which-is-nested-with-multiple-key-value-pair/m-p/58667#M31235</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/98989"&gt;@learning_1989&lt;/a&gt;&amp;nbsp;Please have a look at the following document to see how to read the JSON file in Databricks:&lt;BR /&gt;Document: &lt;A href="https://docs.databricks.com/en/query/formats/json.html#json-file" target="_blank"&gt;https://docs.databricks.com/en/query/formats/json.html#json-file&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This allows you to read JSON files with key-value pairs in&amp;nbsp;&lt;/SPAN&gt;&lt;A class="reference internal" href="https://docs.databricks.com/en/query/formats/json.html#single-line-mode" target="_blank"&gt;&lt;SPAN class="std std-ref"&gt;single-line&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;or&amp;nbsp;&lt;/SPAN&gt;&lt;A class="reference internal" href="https://docs.databricks.com/en/query/formats/json.html#multi-line-mode" target="_blank"&gt;&lt;SPAN class="std std-ref"&gt;multi-line&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;mode. In single-line mode, a file can be split into many parts and read in parallel. In multi-line mode, a file is loaded as a whole entity and&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;cannot&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;be split.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 10:08:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/you-have-json-file-which-is-nested-with-multiple-key-value-pair/m-p/58667#M31235</guid>
      <dc:creator>Ayushi_Suthar</dc:creator>
      <dc:date>2024-01-30T10:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: You have json file which is nested with multiple key value pair how you read it in databricks?</title>
      <link>https://community.databricks.com/t5/data-engineering/you-have-json-file-which-is-nested-with-multiple-key-value-pair/m-p/58691#M31241</link>
      <description>&lt;P&gt;You should be able to read the json file with below code.&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="kd"&gt;val&lt;/SPAN&gt; &lt;SPAN class="n"&gt;df&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="n"&gt;spark&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;read&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;format&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"json"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;).&lt;/SPAN&gt;&lt;SPAN class="n"&gt;load&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"file.json"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;After this you will need to use the explode function to add columns to the dataframe using the nested values.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 11:46:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/you-have-json-file-which-is-nested-with-multiple-key-value-pair/m-p/58691#M31241</guid>
      <dc:creator>Lakshay</dc:creator>
      <dc:date>2024-01-30T11:46:10Z</dc:date>
    </item>
  </channel>
</rss>

