<?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: How do you access a streaming live table's snapshots? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-do-you-access-a-streaming-live-table-s-snapshots/m-p/27957#M19795</link>
    <description>&lt;P&gt;Which tables from your example do you want to query, as none of them is my_table?&lt;/P&gt;</description>
    <pubDate>Sun, 16 Oct 2022 18:28:04 GMT</pubDate>
    <dc:creator>Hubert-Dudek</dc:creator>
    <dc:date>2022-10-16T18:28:04Z</dc:date>
    <item>
      <title>How do you access a streaming live table's snapshots?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-do-you-access-a-streaming-live-table-s-snapshots/m-p/27956#M19794</link>
      <description>&lt;P&gt;I have read that delta live tables will keep a history of 7 days. However after creating a streaming live table and using the dlt.apply_changes function. With this code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;def run_pipeline(table_name,keys,sequence_by):
    lower_table_name = table_name.lower()
    @dlt.view(name = f"{lower_table_name}_schema",
                     comment= "Test")
    def create_raw_schema():
        return(spark.read.format("parquet")
              .option("inferschema", True)
              .load(f"s3://mybucket/test/dbo/{table_name}/")
              .limit(10)
              )
&amp;nbsp;
    #creating hist table
    @dlt.table(name=f"s{lower_table_name}_hist",
                   comment = "test")
    def create_hist_table():
      return (
        spark.readStream.format("cloudFiles")
          .option("cloudFiles.format", "parquet")
          .schema(dlt.read(f"{lower_table_name}_schema").schema)
          .load(f"s3://mybucket/test/dbo/{table_name}/")
      )
 
    #creating current table
    dlt.create_streaming_live_table(
        name = f"{lower_table_name}",
        path = f"s3://mybucket/test/cdc/{table_name}__ct/")
    
    dlt.apply_changes(
        target = f"{lower_table_name}",
        source = f"{lower_table_name}_hist",
        keys = keys,
        sequence_by = col(sequence_by)
    )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; when I attempt to access any version history using &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM dlt.my_table TIMESTAMP AS OF "2022-10-10"&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get this message "Cannot time travel views."&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 17:19:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-do-you-access-a-streaming-live-table-s-snapshots/m-p/27956#M19794</guid>
      <dc:creator>logan0015</dc:creator>
      <dc:date>2022-10-11T17:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do you access a streaming live table's snapshots?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-do-you-access-a-streaming-live-table-s-snapshots/m-p/27957#M19795</link>
      <description>&lt;P&gt;Which tables from your example do you want to query, as none of them is my_table?&lt;/P&gt;</description>
      <pubDate>Sun, 16 Oct 2022 18:28:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-do-you-access-a-streaming-live-table-s-snapshots/m-p/27957#M19795</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-10-16T18:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do you access a streaming live table's snapshots?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-do-you-access-a-streaming-live-table-s-snapshots/m-p/27958#M19796</link>
      <description>&lt;P&gt;I've changed some of code to remove any personal information. The table name is being passed into the pipeline's function from another section of code. my_table was just an example name.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 14:05:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-do-you-access-a-streaming-live-table-s-snapshots/m-p/27958#M19796</guid>
      <dc:creator>logan0015</dc:creator>
      <dc:date>2022-10-19T14:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do you access a streaming live table's snapshots?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-do-you-access-a-streaming-live-table-s-snapshots/m-p/27959#M19797</link>
      <description>&lt;P&gt;Hi @Logan Nicol​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or &lt;B&gt;mark an answer as best&lt;/B&gt;? Else please let us know if you need more help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We'd love to hear from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 07:19:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-do-you-access-a-streaming-live-table-s-snapshots/m-p/27959#M19797</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-17T07:19:07Z</dc:date>
    </item>
  </channel>
</rss>

