<?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: How to merge delta data.. in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-merge-delta-data/m-p/20625#M13937</link>
    <description>&lt;P&gt;Hi @Krishna Kommineni​&amp;nbsp;Is the table partitioned on SRC_SYS_ID col?&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jun 2022 02:10:02 GMT</pubDate>
    <dc:creator>Noopur_Nigam</dc:creator>
    <dc:date>2022-06-02T02:10:02Z</dc:date>
    <item>
      <title>How to merge delta data..</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-merge-delta-data/m-p/20622#M13934</link>
      <description>&lt;P&gt;Data from Parquet to delta converted and delta files written into diff folders based on SRC_SYS_ID....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any one help me how to merge delta data from multiple folders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 22:00:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-merge-delta-data/m-p/20622#M13934</guid>
      <dc:creator>Krishscientist</dc:creator>
      <dc:date>2022-05-13T22:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge delta data..</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-merge-delta-data/m-p/20623#M13935</link>
      <description>&lt;P&gt;@Krishna Kommineni​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MERGE command allows you to perform “upserts”, which are a mix of an&amp;nbsp;UPDATE and an&amp;nbsp;INSERT&lt;/P&gt;&lt;P&gt;To understand upserts, imagine that you have an existing table (a.k.a. a&amp;nbsp;&lt;I&gt;target table&lt;/I&gt;), and a&amp;nbsp;&lt;I&gt;source table&lt;/I&gt;&amp;nbsp;that contains a mix of new records and updates to existing records. Here’s how an upsert works:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;When a record from the source table&amp;nbsp;&lt;B&gt;matches a preexisting record&lt;/B&gt;&amp;nbsp;in the target table, Delta Lake&amp;nbsp;&lt;B&gt;updates&lt;/B&gt;&amp;nbsp;the record.&lt;/LI&gt;&lt;LI&gt;When there is&amp;nbsp;&lt;B&gt;no such match&lt;/B&gt;, Delta Lake&amp;nbsp;&lt;B&gt;inserts&lt;/B&gt;&amp;nbsp;the new record.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example code-&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MERGE INTO events
USING updates
    ON events.eventId = updates.eventId
    WHEN MATCHED THEN UPDATE
        SET events.data = updates.data
    WHEN NOT MATCHED THEN 
        INSERT (date, eventId, data) VALUES (date, eventId, data)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 14 May 2022 06:40:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-merge-delta-data/m-p/20623#M13935</guid>
      <dc:creator>Aashita</dc:creator>
      <dc:date>2022-05-14T06:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge delta data..</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-merge-delta-data/m-p/20625#M13937</link>
      <description>&lt;P&gt;Hi @Krishna Kommineni​&amp;nbsp;Is the table partitioned on SRC_SYS_ID col?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 02:10:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-merge-delta-data/m-p/20625#M13937</guid>
      <dc:creator>Noopur_Nigam</dc:creator>
      <dc:date>2022-06-02T02:10:02Z</dc:date>
    </item>
  </channel>
</rss>

