<?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: Getting error when using CDC in delta live table in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/getting-error-when-using-cdc-in-delta-live-table/m-p/22513#M15425</link>
    <description>&lt;P&gt;Hi @Palzor Lama​,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A streaming live table can only process append queries; that is, queries where new rows are inserted into the source table. Processing updates from source tables, for example, merges and deletes, is not supported. To process updates, see the APPLY CHANGES INTO command. You can do what @Chris Cary​&amp;nbsp;recommended. For more information, check the docs from here &lt;A href="https://docs.databricks.com/data-engineering/delta-live-tables/delta-live-tables-cdc.html#apply-changes-function" target="test_blank"&gt;https://docs.databricks.com/data-engineering/delta-live-tables/delta-live-tables-cdc.html#apply-changes-function&lt;/A&gt; &lt;/P&gt;</description>
    <pubDate>Wed, 01 Jun 2022 23:55:13 GMT</pubDate>
    <dc:creator>jose_gonzalez</dc:creator>
    <dc:date>2022-06-01T23:55:13Z</dc:date>
    <item>
      <title>Getting error when using CDC in delta live table</title>
      <link>https://community.databricks.com/t5/data-engineering/getting-error-when-using-cdc-in-delta-live-table/m-p/22508#M15420</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to use CDC for delta live table, and when when I run the pipeline second time I get an error :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;org.apache.spark.sql.streaming.StreamingQueryException: Query tbl_cdc [id = ***-xx-xx-bf7e-6cb8b0deb690, runId = ***-xxxx-4031-ba74-b4b22be05774] terminated with exception: Detected a data update (for example part-00000-eedcf65d-3aa0.snappy.parquet) in the source table at version 2. This is currently not supported. If you'd like to ignore updates, set the option 'ignoreChanges' to 'true'. If you would like the data update to be reflected, please restart this query with a fresh checkpoint directory.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 06:24:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/getting-error-when-using-cdc-in-delta-live-table/m-p/22508#M15420</guid>
      <dc:creator>palzor</dc:creator>
      <dc:date>2022-04-21T06:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when using CDC in delta live table</title>
      <link>https://community.databricks.com/t5/data-engineering/getting-error-when-using-cdc-in-delta-live-table/m-p/22509#M15421</link>
      <description>&lt;P&gt;@Palzor Lama​&amp;nbsp;, Structured streaming supports only sources which append data. It seems that there is an UPDATE, MERGE INTO, DELETE or OVERWRITE operation on source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 09:40:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/getting-error-when-using-cdc-in-delta-live-table/m-p/22509#M15421</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-04-21T09:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when using CDC in delta live table</title>
      <link>https://community.databricks.com/t5/data-engineering/getting-error-when-using-cdc-in-delta-live-table/m-p/22511#M15423</link>
      <description>&lt;P&gt;@Hubert Dudek​&amp;nbsp;, thanks for your answer, well we have files that we are loading and when we are running the pipeline for the new file that comes in then we get this error. So I think its an append rather than an update.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 22:41:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/getting-error-when-using-cdc-in-delta-live-table/m-p/22511#M15423</guid>
      <dc:creator>palzor</dc:creator>
      <dc:date>2022-04-25T22:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when using CDC in delta live table</title>
      <link>https://community.databricks.com/t5/data-engineering/getting-error-when-using-cdc-in-delta-live-table/m-p/22512#M15424</link>
      <description>&lt;P&gt;Can you use the ignoreChanges when you read your stream? The code would look something like &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import dlt
from pyspark.sql.functions import col, expr
&amp;nbsp;
@dlt.view
def users():
    return (
        spark.readStream
        .format("delta")
        .option("ignoreChanges", "true")
        .table("cdc_data.users")
)
&amp;nbsp;
dlt.create_target_table("target")
&amp;nbsp;
dlt.apply_changes(
  target = "target",
  source = "users",
  keys = ["userId"],
  sequence_by = col("sequenceNum"),
  apply_as_deletes = expr("operation = 'DELETE'"),
  except_column_list = ["operation", "sequenceNum"]
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 14 May 2022 16:06:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/getting-error-when-using-cdc-in-delta-live-table/m-p/22512#M15424</guid>
      <dc:creator>ccary</dc:creator>
      <dc:date>2022-05-14T16:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when using CDC in delta live table</title>
      <link>https://community.databricks.com/t5/data-engineering/getting-error-when-using-cdc-in-delta-live-table/m-p/22513#M15425</link>
      <description>&lt;P&gt;Hi @Palzor Lama​,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A streaming live table can only process append queries; that is, queries where new rows are inserted into the source table. Processing updates from source tables, for example, merges and deletes, is not supported. To process updates, see the APPLY CHANGES INTO command. You can do what @Chris Cary​&amp;nbsp;recommended. For more information, check the docs from here &lt;A href="https://docs.databricks.com/data-engineering/delta-live-tables/delta-live-tables-cdc.html#apply-changes-function" target="test_blank"&gt;https://docs.databricks.com/data-engineering/delta-live-tables/delta-live-tables-cdc.html#apply-changes-function&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 23:55:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/getting-error-when-using-cdc-in-delta-live-table/m-p/22513#M15425</guid>
      <dc:creator>jose_gonzalez</dc:creator>
      <dc:date>2022-06-01T23:55:13Z</dc:date>
    </item>
  </channel>
</rss>

