<?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: DLT Spark readstream fails on the source table which is overwritten in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/dlt-spark-readstream-fails-on-the-source-table-which-is/m-p/3946#M813</link>
    <description>&lt;P&gt;Hi, Could you please confirm DLT and DBR versions? &lt;/P&gt;&lt;P&gt;Also please tag&amp;nbsp;@Debayan​&amp;nbsp;with your next response which will notify me, Thank you!&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jun 2023 07:31:43 GMT</pubDate>
    <dc:creator>Debayan</dc:creator>
    <dc:date>2023-06-05T07:31:43Z</dc:date>
    <item>
      <title>DLT Spark readstream fails on the source table which is overwritten</title>
      <link>https://community.databricks.com/t5/data-engineering/dlt-spark-readstream-fails-on-the-source-table-which-is/m-p/3945#M812</link>
      <description>&lt;P&gt;I am reading the source table which gets updated every day. It is usually append/merge with updates and is occasionally overwritten for other reasons. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;df = spark.readStream.schema(schema).format("delta").option("ignoreChanges", True).option('startingVersion', xx).table('db_name.table_name')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also have the following spark configuration in DLT settings:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"spark.sql.files.ignoreMissingFiles": "true",
"spark.databricks.delta.schema.autoMerge.enabled": "true"&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it throws this error when I try to refresh the pipeline. It also fails when I do full refresh. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt; terminated with exception: Detected schema change:&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;Please try restarting the query. If this issue repeats across query restarts without&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;making progress, you have made an incompatible schema change and need to start your&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;query from scratch using a new checkpoint directory.&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to readStream with the schema,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;schema = spark.read('db_name.table_name').schema
&amp;nbsp;
df = spark.readStream.schema(schema).format("delta").option("ignoreChanges", True).option('startingVersion', xx).table('db_name.table_name')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; it throws the following error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;I&gt;pyspark.sql.utils.AnalysisException: User specified schema not supported with `table`&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 May 2023 04:09:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dlt-spark-readstream-fails-on-the-source-table-which-is/m-p/3945#M812</guid>
      <dc:creator>gg_047320_gg_94</dc:creator>
      <dc:date>2023-05-28T04:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: DLT Spark readstream fails on the source table which is overwritten</title>
      <link>https://community.databricks.com/t5/data-engineering/dlt-spark-readstream-fails-on-the-source-table-which-is/m-p/3946#M813</link>
      <description>&lt;P&gt;Hi, Could you please confirm DLT and DBR versions? &lt;/P&gt;&lt;P&gt;Also please tag&amp;nbsp;@Debayan​&amp;nbsp;with your next response which will notify me, Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 07:31:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dlt-spark-readstream-fails-on-the-source-table-which-is/m-p/3946#M813</guid>
      <dc:creator>Debayan</dc:creator>
      <dc:date>2023-06-05T07:31:43Z</dc:date>
    </item>
  </channel>
</rss>

