<?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: Error &amp;quot;insert concurrent to Delta Lake&amp;quot; when 2 streaming merge data to same table at t in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/error-quot-insert-concurrent-to-delta-lake-quot-when-2-streaming/m-p/113777#M44628</link>
    <description>&lt;P&gt;&amp;nbsp;Anyone else can help me this case &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Mar 2025 03:26:24 GMT</pubDate>
    <dc:creator>khangnguyen164</dc:creator>
    <dc:date>2025-03-27T03:26:24Z</dc:date>
    <item>
      <title>Error "insert concurrent to Delta Lake" when 2 streaming merge data to same table at the same time</title>
      <link>https://community.databricks.com/t5/data-engineering/error-quot-insert-concurrent-to-delta-lake-quot-when-2-streaming/m-p/113631#M44583</link>
      <description>&lt;P&gt;Hello everyone ,&lt;/P&gt;&lt;P&gt;We currently have 2 streaming (Bronze job) created on 2 tasks in the same job, running the same compute job and both merge data into the same table (Silver table). If I create it like above, sometimes I get an error related to "insert concurrent" because Delta Lake has blocked it.&lt;/P&gt;&lt;P&gt;But when I declare both streaming in the same task, the error does not occur. I have declared both streaming in the same task (file). brz1 = df1.readStream...start() brz2 = df2.readStream...start()&lt;/P&gt;&lt;P&gt;I hope someone can help me why when I create two streaming in the same task the "insert concurrent" error does not occur&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 02:35:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-quot-insert-concurrent-to-delta-lake-quot-when-2-streaming/m-p/113631#M44583</guid>
      <dc:creator>khangnguyen164</dc:creator>
      <dc:date>2025-03-26T02:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error "insert concurrent to Delta Lake" when 2 streaming merge data to same table at t</title>
      <link>https://community.databricks.com/t5/data-engineering/error-quot-insert-concurrent-to-delta-lake-quot-when-2-streaming/m-p/113632#M44584</link>
      <description>&lt;P&gt;Sorry for sending the wrong information. I created 2 streams in the same task.&amp;nbsp;&lt;SPAN&gt;brz1 = df1.writeStream...start() brz2 = df2.writeStream...start().&amp;nbsp;Please ignore my typo above as I am just giving the example the way I did it.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 02:39:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-quot-insert-concurrent-to-delta-lake-quot-when-2-streaming/m-p/113632#M44584</guid>
      <dc:creator>khangnguyen164</dc:creator>
      <dc:date>2025-03-26T02:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error "insert concurrent to Delta Lake" when 2 streaming merge data to same table at t</title>
      <link>https://community.databricks.com/t5/data-engineering/error-quot-insert-concurrent-to-delta-lake-quot-when-2-streaming/m-p/113777#M44628</link>
      <description>&lt;P&gt;&amp;nbsp;Anyone else can help me this case &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2025 03:26:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-quot-insert-concurrent-to-delta-lake-quot-when-2-streaming/m-p/113777#M44628</guid>
      <dc:creator>khangnguyen164</dc:creator>
      <dc:date>2025-03-27T03:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error "insert concurrent to Delta Lake" when 2 streaming merge data to same table at t</title>
      <link>https://community.databricks.com/t5/data-engineering/error-quot-insert-concurrent-to-delta-lake-quot-when-2-streaming/m-p/113792#M44636</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/155218"&gt;@khangnguyen164&lt;/a&gt;!&lt;/P&gt;
&lt;P data-start="103" data-end="354"&gt;When both streaming writes run in the same task, they are processed sequentially, likely sharing the same transaction context. This prevents concurrent insert conflicts, as micro-batches are scheduled one after another within the same Spark context.&lt;/P&gt;
&lt;P data-start="356" data-end="582"&gt;However, when the streams run in separate tasks, they execute independently. This parallel execution can lead to conflicts like &lt;EM&gt;ConcurrentAppendException&lt;/EM&gt;&amp;nbsp;when both tasks try to write to the same Delta table simultaneously.&lt;/P&gt;
&lt;P data-start="584" data-end="614"&gt;For more details, check out&amp;nbsp;&lt;A href="https://docs.delta.io/latest/concurrency-control.html" target="_new" rel="noopener" data-start="617" data-end="706"&gt;Concurrency control&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&amp;amp; &lt;A href="https://community.databricks.com/t5/data-engineering/concurrent-writes-to-the-same-delta-table/td-p/107617" target="_blank"&gt;Concurrent Writes to the same DELTA TABLE&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2025 10:24:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-quot-insert-concurrent-to-delta-lake-quot-when-2-streaming/m-p/113792#M44636</guid>
      <dc:creator>Advika</dc:creator>
      <dc:date>2025-03-27T10:24:39Z</dc:date>
    </item>
  </channel>
</rss>

