<?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: Resource exhaustion when using default apply_changes python functionality in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/resource-exhaustion-when-using-default-apply-changes-python/m-p/55638#M30391</link>
    <description>&lt;P&gt;Hi Lena1,&lt;BR /&gt;there is no magic behind the scene.&lt;BR /&gt;If you write readstream from bronze table and writestream with ForEachBatch(function) and in function you will write MERGE stattemnt this will have similiar performance.&lt;BR /&gt;Maybe there is a lot of shuffeling happening or source tables are not optimized (a lot of small files).&lt;BR /&gt;This is hard to tell w/o looking on data and metrics &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;Wojciech&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Dec 2023 23:45:37 GMT</pubDate>
    <dc:creator>Wojciech_BUK</dc:creator>
    <dc:date>2023-12-21T23:45:37Z</dc:date>
    <item>
      <title>Resource exhaustion when using default apply_changes python functionality</title>
      <link>https://community.databricks.com/t5/data-engineering/resource-exhaustion-when-using-default-apply-changes-python/m-p/55585#M30373</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;We are currently setting up streaming&amp;nbsp; CDC pipelines for more than 500 tables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Due to the high number of tables, we split our tables into multiple pipelines, we use multiple DLT pipelines per layer: bronze, silver gold&lt;/P&gt;&lt;P&gt;In silver, we only upsert using the apply_changes function as describe here :&amp;nbsp;&lt;A href="https://docs.databricks.com/en/delta-live-tables/python-ref.html#cdc" target="_blank"&gt;https://docs.databricks.com/en/delta-live-tables/python-ref.html#cdc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, we see that when we run silver pipelines, that there is an exhaustion in memory as well as the nodes which are used.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So now, in order to reduce costs, we are wondering why this is the case and how to optimize it. It is a bit hard as the code here is not open source and we couldn't find any reference yet for optimizing the apply_changes function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody know what is happening in the background/ why it is taking that many resources and how to optimize it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is welcome!&lt;/P&gt;&lt;P&gt;Thank you in advance!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 08:17:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/resource-exhaustion-when-using-default-apply-changes-python/m-p/55585#M30373</guid>
      <dc:creator>lena1</dc:creator>
      <dc:date>2023-12-21T08:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Resource exhaustion when using default apply_changes python functionality</title>
      <link>https://community.databricks.com/t5/data-engineering/resource-exhaustion-when-using-default-apply-changes-python/m-p/55638#M30391</link>
      <description>&lt;P&gt;Hi Lena1,&lt;BR /&gt;there is no magic behind the scene.&lt;BR /&gt;If you write readstream from bronze table and writestream with ForEachBatch(function) and in function you will write MERGE stattemnt this will have similiar performance.&lt;BR /&gt;Maybe there is a lot of shuffeling happening or source tables are not optimized (a lot of small files).&lt;BR /&gt;This is hard to tell w/o looking on data and metrics &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;Wojciech&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 23:45:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/resource-exhaustion-when-using-default-apply-changes-python/m-p/55638#M30391</guid>
      <dc:creator>Wojciech_BUK</dc:creator>
      <dc:date>2023-12-21T23:45:37Z</dc:date>
    </item>
  </channel>
</rss>

