<?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: Multiple streaming sources to the same delta table in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/multiple-streaming-sources-to-the-same-delta-table/m-p/19070#M12729</link>
    <description>&lt;P&gt;Hi @Zachary Higgins​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, we are also using Trigger.once so that we can handle the merge stream dependencies properly. But was wondering whether we can scale our pipeline to be streaming by changing the Trigger duration in the future&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the heads up regarding Concurrency, I was assuming a Pessimistic concurrency control&amp;nbsp;where delta would handle concurrent writes to the same partition without exceptions or data corruption.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think we can support full streaming pipelines if there can be concurrency issues&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jun 2022 10:57:10 GMT</pubDate>
    <dc:creator>hari</dc:creator>
    <dc:date>2022-06-02T10:57:10Z</dc:date>
    <item>
      <title>Multiple streaming sources to the same delta table</title>
      <link>https://community.databricks.com/t5/data-engineering/multiple-streaming-sources-to-the-same-delta-table/m-p/19068#M12727</link>
      <description>&lt;P&gt;Is it possible to have two streaming sources doing Merge into the same delta table with each source setting a different set of fields?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are trying to create a single table which will be used by the service layer for queries. The table can be populated from multiple source tables each contributing a set of fields to the sink schema.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample query for the scenario:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MERGE INTO sink
   USING source_a
   ON source_a.id = sink.id
   WHEN MATCHED THEN
     UPDATE SET
       id = source_a.id,
       summary = source_a.summary,
       description = source_a.description,
       customerId = source_a.customerId
   WHEN NOT MATCHED
  THEN INSERT (
    id,
    summary,
    description,
    customerId
  )
  VALUES (
    source_a.id,
    source_a.summary,
    source_a.description,
    source_a.customerId
  )&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;MERGE INTO sink
   USING source_b
   ON source_b.customer.id = sink.customerId
   WHEN MATCHED THEN
     UPDATE SET
       customerId = source_b.customerId,
       customerName = source_b.customerName,
       customerIndustry = source_b.customerIndustry&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am new to streaming and was wondering whether there is some way to implement this using streaming queries. Currently seeing out of order issues when merging the data to the sink, But is there something which can be done to go around the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 10:48:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/multiple-streaming-sources-to-the-same-delta-table/m-p/19068#M12727</guid>
      <dc:creator>hari</dc:creator>
      <dc:date>2022-06-01T10:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple streaming sources to the same delta table</title>
      <link>https://community.databricks.com/t5/data-engineering/multiple-streaming-sources-to-the-same-delta-table/m-p/19069#M12728</link>
      <description>&lt;P&gt;Not sure about your partitioning schema, but be careful, as you can run into issues with concurrent updates to the same partition. &lt;A href="https://docs.databricks.com/delta/concurrency-control.html" alt="https://docs.databricks.com/delta/concurrency-control.html" target="_blank"&gt;Concurrency control | Databricks on AWS&lt;/A&gt;. In this case, I usually set the trigger to run once, running each merge update synchronously, and putting the job on a schedule.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What kind of "out of order" issues are you seeing?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 21:43:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/multiple-streaming-sources-to-the-same-delta-table/m-p/19069#M12728</guid>
      <dc:creator>Zachary_Higgins</dc:creator>
      <dc:date>2022-06-01T21:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple streaming sources to the same delta table</title>
      <link>https://community.databricks.com/t5/data-engineering/multiple-streaming-sources-to-the-same-delta-table/m-p/19070#M12729</link>
      <description>&lt;P&gt;Hi @Zachary Higgins​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, we are also using Trigger.once so that we can handle the merge stream dependencies properly. But was wondering whether we can scale our pipeline to be streaming by changing the Trigger duration in the future&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the heads up regarding Concurrency, I was assuming a Pessimistic concurrency control&amp;nbsp;where delta would handle concurrent writes to the same partition without exceptions or data corruption.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think we can support full streaming pipelines if there can be concurrency issues&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 10:57:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/multiple-streaming-sources-to-the-same-delta-table/m-p/19070#M12729</guid>
      <dc:creator>hari</dc:creator>
      <dc:date>2022-06-02T10:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple streaming sources to the same delta table</title>
      <link>https://community.databricks.com/t5/data-engineering/multiple-streaming-sources-to-the-same-delta-table/m-p/19072#M12731</link>
      <description>&lt;P&gt;Hi @Kaniz Fatma​&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking for a similar use case where we have MULTIPLE SOURCE TABLES IN BRONZE/Silver and would need to push data into the same TARGET TABLE. We have adopted a Data Vault as our data Model for Silver. If you could provide some documentation or URL that would be great.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 18:17:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/multiple-streaming-sources-to-the-same-delta-table/m-p/19072#M12731</guid>
      <dc:creator>Shourya</dc:creator>
      <dc:date>2023-01-20T18:17:41Z</dc:date>
    </item>
  </channel>
</rss>

