<?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 unvalidated the primary and foreign keys constraints? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/unvalidated-the-primary-and-foreign-keys-constraints/m-p/102158#M40995</link>
    <description>&lt;P&gt;Hello community,&lt;BR /&gt;I'm inserting in a table defined (with primary key and foreign key set) some records in overwrite mode every moment I run a workflow where the task is defined. Why after inserting those records the DDL schema changes? Why I have my primary and foreign keys unset? Seems that changes the schema!&lt;/P&gt;</description>
    <pubDate>Sun, 15 Dec 2024 16:57:06 GMT</pubDate>
    <dc:creator>jeremy98</dc:creator>
    <dc:date>2024-12-15T16:57:06Z</dc:date>
    <item>
      <title>unvalidated the primary and foreign keys constraints?</title>
      <link>https://community.databricks.com/t5/data-engineering/unvalidated-the-primary-and-foreign-keys-constraints/m-p/102158#M40995</link>
      <description>&lt;P&gt;Hello community,&lt;BR /&gt;I'm inserting in a table defined (with primary key and foreign key set) some records in overwrite mode every moment I run a workflow where the task is defined. Why after inserting those records the DDL schema changes? Why I have my primary and foreign keys unset? Seems that changes the schema!&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2024 16:57:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unvalidated-the-primary-and-foreign-keys-constraints/m-p/102158#M40995</guid>
      <dc:creator>jeremy98</dc:creator>
      <dc:date>2024-12-15T16:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: unvalidated the primary and foreign keys constraints?</title>
      <link>https://community.databricks.com/t5/data-engineering/unvalidated-the-primary-and-foreign-keys-constraints/m-p/102175#M41003</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/133094"&gt;@jeremy98&lt;/a&gt;,&lt;/P&gt;
&lt;P class="p1"&gt;When you use the "insert overwrite" mode in Databricks, it can lead to the schema being reset, which includes the removal of primary and foreign key constraints. This happens because the "insert overwrite" operation essentially replaces the entire table, which can result in the loss of any constraints that were previously defined&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;To maintain your primary and foreign key constraints, you might consider using a different strategy for updating your table. For example, using the "merge" strategy instead of "insert overwrite" can help preserve the schema and constraints. The "merge" strategy allows you to update, insert, or delete records based on a condition, which can be more efficient and less disruptive to the schema&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2024 23:43:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unvalidated-the-primary-and-foreign-keys-constraints/m-p/102175#M41003</guid>
      <dc:creator>Alberto_Umana</dc:creator>
      <dc:date>2024-12-15T23:43:07Z</dc:date>
    </item>
  </channel>
</rss>

