<?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: readStream with readChangeFeed option in SQL in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/readstream-with-readchangefeed-option-in-sql/m-p/132142#M49368</link>
    <description>&lt;P class="p1"&gt;Greetings &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/183972"&gt;@gerard_gv&lt;/a&gt;&amp;nbsp;, there isn’t currently a direct SQL equivalent to the &lt;SPAN class="s1"&gt;&lt;STRONG&gt;readChangeFeed&lt;/STRONG&gt;&lt;/SPAN&gt; option. This option is only supported in streaming through the Python and Scala DataFrame APIs.&lt;/P&gt;
&lt;P class="p1"&gt;As a workaround, take a look at the &lt;SPAN class="s1"&gt;&lt;STRONG&gt;table_changes&lt;/STRONG&gt;&lt;/SPAN&gt; SQL function. For example:&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;-- Read changes between specific versions&lt;/P&gt;
&lt;P class="p1"&gt;SELECT * FROM table_changes('table_name', 5, 10);&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;-- Read changes starting from a timestamp&lt;/P&gt;
&lt;P class="p1"&gt;SELECT * FROM table_changes('table_name', '2023-01-01T00:00:00.000Z');&lt;/P&gt;
&lt;P class="p1"&gt;It is not exactly what you are looking for but it may be a viable work around.&lt;/P&gt;
&lt;P class="p1"&gt;I hope this helps, Louis.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Sep 2025 17:04:31 GMT</pubDate>
    <dc:creator>Louis_Frolio</dc:creator>
    <dc:date>2025-09-16T17:04:31Z</dc:date>
    <item>
      <title>readStream with readChangeFeed option in SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/readstream-with-readchangefeed-option-in-sql/m-p/131561#M49137</link>
      <description>&lt;P&gt;I have been some days trying to find the equivalent SQL for:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;spark.readStream
        .option("readChangeFeed", "true")
        .table("table_name")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I suspect that it works like &lt;SPAN class=""&gt;&lt;STRONG&gt;AUTO CDC FROM SNAPSHOT&lt;/STRONG&gt;&lt;/SPAN&gt;, since CDF adds the column "&lt;SPAN class=""&gt;_commit_version"&lt;/SPAN&gt;, a &lt;SPAN class=""&gt;bigint&lt;/SPAN&gt; field that might be used as a snapshot ID behind the scenes, which could explain why there is no direct SQL equivalent since the documentation says "&lt;EM&gt;Use AUTO CDC FROM SNAPSHOT (Public Preview, &lt;STRONG&gt;and only available for Python&lt;/STRONG&gt;) to process changes in database snapshots&lt;/EM&gt;". Documentation: &lt;A href="https://docs.databricks.com/aws/en/dlt/cdc" target="_blank" rel="noopener"&gt;https://docs.databricks.com/aws/en/dlt/cdc&lt;/A&gt;&lt;/P&gt;&lt;P class=""&gt;I also tried to check the difference between the table properties of a streaming table created with the following SQL and one created with Python using &lt;SPAN class=""&gt;readChangeFeed = true&lt;/SPAN&gt;. However, the table created with Python only has &lt;SPAN class=""&gt;pipelineId&lt;/SPAN&gt; in its properties.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CREATE OR REPLACE STREAMING TABLE
    target_table_name
AS SELECT
    *
FROM
    STREAM(table_name)&lt;/LI-CODE&gt;&lt;P&gt;Thanks in advance&lt;span class="lia-unicode-emoji" title=":downcast_face_with_sweat:"&gt;😓&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2025 16:22:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/readstream-with-readchangefeed-option-in-sql/m-p/131561#M49137</guid>
      <dc:creator>gerard_gv</dc:creator>
      <dc:date>2025-09-10T16:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: readStream with readChangeFeed option in SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/readstream-with-readchangefeed-option-in-sql/m-p/132142#M49368</link>
      <description>&lt;P class="p1"&gt;Greetings &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/183972"&gt;@gerard_gv&lt;/a&gt;&amp;nbsp;, there isn’t currently a direct SQL equivalent to the &lt;SPAN class="s1"&gt;&lt;STRONG&gt;readChangeFeed&lt;/STRONG&gt;&lt;/SPAN&gt; option. This option is only supported in streaming through the Python and Scala DataFrame APIs.&lt;/P&gt;
&lt;P class="p1"&gt;As a workaround, take a look at the &lt;SPAN class="s1"&gt;&lt;STRONG&gt;table_changes&lt;/STRONG&gt;&lt;/SPAN&gt; SQL function. For example:&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;-- Read changes between specific versions&lt;/P&gt;
&lt;P class="p1"&gt;SELECT * FROM table_changes('table_name', 5, 10);&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;-- Read changes starting from a timestamp&lt;/P&gt;
&lt;P class="p1"&gt;SELECT * FROM table_changes('table_name', '2023-01-01T00:00:00.000Z');&lt;/P&gt;
&lt;P class="p1"&gt;It is not exactly what you are looking for but it may be a viable work around.&lt;/P&gt;
&lt;P class="p1"&gt;I hope this helps, Louis.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2025 17:04:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/readstream-with-readchangefeed-option-in-sql/m-p/132142#M49368</guid>
      <dc:creator>Louis_Frolio</dc:creator>
      <dc:date>2025-09-16T17:04:31Z</dc:date>
    </item>
  </channel>
</rss>

