<?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 Restoring a table from a Delta live pipeline in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/restoring-a-table-from-a-delta-live-pipeline/m-p/103855#M41576</link>
    <description>&lt;P&gt;I have a DLT pipeline running to ingest files from storage using autoloader. We have a bronze table and a Silver table.&lt;/P&gt;&lt;P&gt;A question came up from the team on how to restore DLT tables to a previous version in case of some incorrect transformation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When we try to execute the RESTORE to version command we get the below error.&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;SPAN&gt;[STREAMING_TABLE_OPERATION_NOT_ALLOWED.UNSUPPORTED_OPERATION] The operation RESTORE is not allowed: The operation is not supported on Streaming Tables. SQLSTATE: 42601&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Then I tried deleting some records from the Silver table and restart the pipeline. Since the tables are streaming, the deleted records are not repopulated from silver.&lt;/P&gt;&lt;P&gt;So my questions are :&lt;/P&gt;&lt;P&gt;1) What is the best way to restore a DLT table to its previous version and do a backfill or rerun of the last DLT run?&lt;/P&gt;&lt;P&gt;2) Do we have to do a full refresh to accomplish this?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jan 2025 03:28:24 GMT</pubDate>
    <dc:creator>Edthehead</dc:creator>
    <dc:date>2025-01-02T03:28:24Z</dc:date>
    <item>
      <title>Restoring a table from a Delta live pipeline</title>
      <link>https://community.databricks.com/t5/data-engineering/restoring-a-table-from-a-delta-live-pipeline/m-p/103855#M41576</link>
      <description>&lt;P&gt;I have a DLT pipeline running to ingest files from storage using autoloader. We have a bronze table and a Silver table.&lt;/P&gt;&lt;P&gt;A question came up from the team on how to restore DLT tables to a previous version in case of some incorrect transformation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When we try to execute the RESTORE to version command we get the below error.&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;SPAN&gt;[STREAMING_TABLE_OPERATION_NOT_ALLOWED.UNSUPPORTED_OPERATION] The operation RESTORE is not allowed: The operation is not supported on Streaming Tables. SQLSTATE: 42601&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Then I tried deleting some records from the Silver table and restart the pipeline. Since the tables are streaming, the deleted records are not repopulated from silver.&lt;/P&gt;&lt;P&gt;So my questions are :&lt;/P&gt;&lt;P&gt;1) What is the best way to restore a DLT table to its previous version and do a backfill or rerun of the last DLT run?&lt;/P&gt;&lt;P&gt;2) Do we have to do a full refresh to accomplish this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 03:28:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restoring-a-table-from-a-delta-live-pipeline/m-p/103855#M41576</guid>
      <dc:creator>Edthehead</dc:creator>
      <dc:date>2025-01-02T03:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Restoring a table from a Delta live pipeline</title>
      <link>https://community.databricks.com/t5/data-engineering/restoring-a-table-from-a-delta-live-pipeline/m-p/103904#M41599</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The &lt;CODE&gt;RESTORE&lt;/CODE&gt; command is not supported on streaming tables, which is why you encountered the error. Instead, you can use the &lt;CODE&gt;TIME TRAVEL&lt;/CODE&gt; feature of Delta Lake to query previous versions of the table. You can use the &lt;CODE&gt;VERSION AS OF&lt;/CODE&gt; or &lt;CODE&gt;TIMESTAMP AS OF&lt;/CODE&gt; clauses in your SQL queries to access historical data.&lt;BR /&gt;&lt;/SPAN&gt;Example:&lt;/P&gt;
&lt;DIV class="gb5fhw2"&gt;
&lt;PRE&gt;&lt;CODE class="markdown-code-sql _1t7bu9hb hljs language-sql gb5fhw3"&gt;&lt;SPAN class="hljs-keyword"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="hljs-operator"&gt;*&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;FROM&lt;/SPAN&gt; my_table VERSION &lt;SPAN class="hljs-keyword"&gt;AS&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;OF&lt;/SPAN&gt; &lt;SPAN class="hljs-number"&gt;10&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;P&gt;Since the tables are streaming, simply deleting records and restarting the pipeline will not repopulate the deleted records. Instead, you need to perform a full refresh of the pipeline.&lt;BR /&gt;&lt;SPAN&gt;To do a full refresh, you can use the "Full Refresh all" option in the DLT pipeline UI. This will recompute and backfill all tables in the pipeline.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Alternatively, you can use the "Select Table for Refresh" option to refresh only specific tables, such as your Silver tables.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 12:10:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restoring-a-table-from-a-delta-live-pipeline/m-p/103904#M41599</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2025-01-02T12:10:39Z</dc:date>
    </item>
  </channel>
</rss>

