<?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 : . If you expect to delete or update rows to the source table in the future....... in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/error-if-you-expect-to-delete-or-update-rows-to-the-source-table/m-p/60139#M31595</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/87732"&gt;@rt-slowth&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just checking in if the provided solution was helpful to you. If yes, please accept this as a Best Solution so that this thread can be considered closed.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Feb 2024 06:41:53 GMT</pubDate>
    <dc:creator>Palash01</dc:creator>
    <dc:date>2024-02-14T06:41:53Z</dc:date>
    <item>
      <title>Error : . If you expect to delete or update rows to the source table in the future.......</title>
      <link>https://community.databricks.com/t5/data-engineering/error-if-you-expect-to-delete-or-update-rows-to-the-source-table/m-p/59547#M31440</link>
      <description>&lt;P&gt;Flow 'user_silver' has FAILED fatally. An error occurred because we detected an update or delete to one or more rows in the source table. Streaming tables may only use append-only streaming sources. If you expect to delete or update rows to the source table in the future, please convert table user_silver to a live table instead of a streaming live table. To resolve this issue, perform a Full Refresh to table user_silver. A Full Refresh will attempt to clear all data from table user_silver and then load all data from the streaming source.&lt;BR /&gt;&lt;BR /&gt;The non-append change can be found at version 11.&lt;BR /&gt;Operation: MERGE&lt;BR /&gt;Username: doheekim&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When&amp;nbsp;I&amp;nbsp;create&amp;nbsp;a&amp;nbsp;silver&amp;nbsp;table&amp;nbsp;in&amp;nbsp;Databricks&amp;nbsp;that&amp;nbsp;uses&amp;nbsp;the&amp;nbsp;table&amp;nbsp;to&amp;nbsp;which&amp;nbsp;dlt.apply_changes&amp;nbsp;is&amp;nbsp;applied&amp;nbsp;as&amp;nbsp;the&amp;nbsp;source&amp;nbsp;data,&amp;nbsp;why&amp;nbsp;does&amp;nbsp;the&amp;nbsp;first&amp;nbsp;run&amp;nbsp;work&amp;nbsp;fine,&amp;nbsp;but&amp;nbsp;an&amp;nbsp;error&amp;nbsp;is&amp;nbsp;thrown&amp;nbsp;saying&amp;nbsp;that&amp;nbsp;only&amp;nbsp;appned&amp;nbsp;is&amp;nbsp;possible&amp;nbsp;from&amp;nbsp;the&amp;nbsp;second&amp;nbsp;run?&lt;/SPAN&gt;&lt;BR /&gt;Source table name: user&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 06:04:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-if-you-expect-to-delete-or-update-rows-to-the-source-table/m-p/59547#M31440</guid>
      <dc:creator>rt-slowth</dc:creator>
      <dc:date>2024-02-07T06:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Error : . If you expect to delete or update rows to the source table in the future.......</title>
      <link>https://community.databricks.com/t5/data-engineering/error-if-you-expect-to-delete-or-update-rows-to-the-source-table/m-p/59554#M31443</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Can you give me some example code on how to switch to live tables using pyspark?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 06:45:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-if-you-expect-to-delete-or-update-rows-to-the-source-table/m-p/59554#M31443</guid>
      <dc:creator>rt-slowth</dc:creator>
      <dc:date>2024-02-07T06:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Error : . If you expect to delete or update rows to the source table in the future.......</title>
      <link>https://community.databricks.com/t5/data-engineering/error-if-you-expect-to-delete-or-update-rows-to-the-source-table/m-p/59556#M31444</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/87732"&gt;@rt-slowth&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adding to&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt;'s points and refereeing to your bronze and silver code you posted in &lt;A title="questions-about-the-design-of-bronze-silver-and-gold-for-live" href="https://community.databricks.com/t5/data-engineering/questions-about-the-design-of-bronze-silver-and-gold-for-live/td-p/59009" target="_self"&gt;questions-about-the-design-of-bronze-silver-and-gold-for-live&lt;/A&gt;&amp;nbsp;post. Looks like you are doing a SCD operation on your bronze layer which explains why the pipeline is erroring out in the subsequent run. To over come this you can try as explained by Kaniz in her post.&lt;/P&gt;&lt;P&gt;Also, the code to switch to live tables is using readStream and writeStream functions in your code.&lt;/P&gt;&lt;P&gt;For writing the streaming table:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;query = transformed_stream \
    .writeStream \
    .format("delta") \
    .option("checkpointLocation", "/databricks/dbfs/checkpoints") \
    .trigger(processingTime="5 minutes") \
    .start("/databricks/dbfs/live_tables/my_live_table")&lt;/LI-CODE&gt;&lt;P&gt;For reading a streaming table:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;source_stream = spark.readStream \
    .format("delta") \
    .option("path", "/databricks/dbfs/mnt/landing_zone") \
    .option("processingTime", "1 minute") \
    .load()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 07:01:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-if-you-expect-to-delete-or-update-rows-to-the-source-table/m-p/59556#M31444</guid>
      <dc:creator>Palash01</dc:creator>
      <dc:date>2024-02-07T07:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Error : . If you expect to delete or update rows to the source table in the future.......</title>
      <link>https://community.databricks.com/t5/data-engineering/error-if-you-expect-to-delete-or-update-rows-to-the-source-table/m-p/60139#M31595</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/87732"&gt;@rt-slowth&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just checking in if the provided solution was helpful to you. If yes, please accept this as a Best Solution so that this thread can be considered closed.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 06:41:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-if-you-expect-to-delete-or-update-rows-to-the-source-table/m-p/60139#M31595</guid>
      <dc:creator>Palash01</dc:creator>
      <dc:date>2024-02-14T06:41:53Z</dc:date>
    </item>
  </channel>
</rss>

