<?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 Flattening VARIANT column. in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/flattening-variant-column/m-p/116752#M45368</link>
    <description>&lt;P&gt;Hi Team, I am facing an issue, i have a json file which is around 700kb and it contains only 1 record, so after reading the data and flattening the file the record is now 620 million. Now while i am writing the dataframe into delta lake it is taking 24 hours to load the data. Could you please suggest a way where i can optimize and decrease the write time. also we are trying using VARIANT data type but stuck in flattening as normal flattening function made for json/struct is not working.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Apr 2025 11:48:49 GMT</pubDate>
    <dc:creator>ABINASH</dc:creator>
    <dc:date>2025-04-28T11:48:49Z</dc:date>
    <item>
      <title>Flattening VARIANT column.</title>
      <link>https://community.databricks.com/t5/data-engineering/flattening-variant-column/m-p/116752#M45368</link>
      <description>&lt;P&gt;Hi Team, I am facing an issue, i have a json file which is around 700kb and it contains only 1 record, so after reading the data and flattening the file the record is now 620 million. Now while i am writing the dataframe into delta lake it is taking 24 hours to load the data. Could you please suggest a way where i can optimize and decrease the write time. also we are trying using VARIANT data type but stuck in flattening as normal flattening function made for json/struct is not working.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 11:48:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/flattening-variant-column/m-p/116752#M45368</guid>
      <dc:creator>ABINASH</dc:creator>
      <dc:date>2025-04-28T11:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Flattening VARIANT column.</title>
      <link>https://community.databricks.com/t5/data-engineering/flattening-variant-column/m-p/117055#M45417</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/162323"&gt;@ABINASH&lt;/a&gt;,&amp;nbsp;The JSON file being flattened to 620 million records seems like the area of optimization would be to restructure the JSON file. My initial thought being that the JSON file is extremely nested which is causing a large amount of redundant information within the flattening. I would try finding the highest cardinality column in the flattened table and then extracting that data from the JSON file before flattening it. You could do this for a number of columns and simply have a foreign key between two tables that can be joined back together at a later period.&lt;/P&gt;&lt;P&gt;Could you present a snippet of the JSON file?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 01:15:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/flattening-variant-column/m-p/117055#M45417</guid>
      <dc:creator>samshifflett46</dc:creator>
      <dc:date>2025-04-30T01:15:01Z</dc:date>
    </item>
  </channel>
</rss>

