<?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: cdc type 2 - not closing records in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/cdc-type-2-not-closing-records/m-p/44582#M27675</link>
    <description>&lt;P&gt;For anyone who sees this post in the future. I was missing one argument&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;apply_as_deletes&lt;/SPAN&gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Sep 2023 07:48:46 GMT</pubDate>
    <dc:creator>MariuszJ</dc:creator>
    <dc:date>2023-09-13T07:48:46Z</dc:date>
    <item>
      <title>cdc type 2 - not closing records</title>
      <link>https://community.databricks.com/t5/data-engineering/cdc-type-2-not-closing-records/m-p/43777#M27543</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;i would not mind small advice, i do have dlt cdc typ2, the definition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;dlt.create_streaming_table('`my_table_dlt_cdc`')
dlt.apply_changes(
  target = 'my_table_dlt_cdc',
  source = 'source',
  keys = ['id'],
  sequence_by = col('snapshot_date'),
  # ignore_null_updates = True,
  except_column_list = ['snapshot_date'],
  stored_as_scd_type = "2"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the table it self is very simple&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;id| val    | snapshot_date
1 | 'abc' | 2023-01-01&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The '1' is stopped to exist in source table after march, but cdc never closed the row. Data for whole 2023 has been loaded (up to today).&lt;BR /&gt;&lt;BR /&gt;When querying&amp;nbsp;&lt;SPAN&gt;__apply_changes_storage_my_table_dlt_cdc i do see last entry in march but nothing after, row was not closed.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;id,value,__recordStartAt,__START_AT,__END_AT,__rowIsHidden
1,'ABC',2023-03-17,2019-07-05,null,true
1,'ABC',2023-03-24,2019-07-05,null,true
1,'ABC',2023-03-31,2019-07-05,null,false&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do have a feeling that I'm missing something obvious... But what.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 11:25:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cdc-type-2-not-closing-records/m-p/43777#M27543</guid>
      <dc:creator>MariuszJ</dc:creator>
      <dc:date>2023-09-06T11:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: cdc type 2 - not closing records</title>
      <link>https://community.databricks.com/t5/data-engineering/cdc-type-2-not-closing-records/m-p/44582#M27675</link>
      <description>&lt;P&gt;For anyone who sees this post in the future. I was missing one argument&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;apply_as_deletes&lt;/SPAN&gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 07:48:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cdc-type-2-not-closing-records/m-p/44582#M27675</guid>
      <dc:creator>MariuszJ</dc:creator>
      <dc:date>2023-09-13T07:48:46Z</dc:date>
    </item>
  </channel>
</rss>

