<?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: Partition cols for a temporary table in Lakefow SDP in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151729#M53695</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/193958"&gt;@IM_01&lt;/a&gt;,&lt;/P&gt;
&lt;P class="p8i6j01 paragraph"&gt;You’re correct on both points.&amp;nbsp;A view is purely logical, and a&amp;nbsp;streaming table still needs an append-only source. What makes this work is that streaming is applied to the underlying Delta tables, not to the view object itself.&lt;/P&gt;
&lt;P&gt;When you do STREAM(my_view) or spark.readStream.table("my_view"), Databricks expands the view definition (CREATE VIEW my_view AS SELECT ... FROM base_table ...) and builds a streaming plan directly over the base Delta table(s) that the view references.&amp;nbsp;In other words, it’s equivalent to copying the view’s SELECT into your streaming query. The fact that it’s called a view is just naming. The streaming engine still talks to the underlying Delta tables.&lt;/P&gt;
&lt;P&gt;The constraint "source must be append‑only" is checked on the Delta table behind the view, not on the view itself.&amp;nbsp;Structured Streaming only supports streaming from Delta tables if upstream writes are append‑only.&amp;nbsp; UPDATE/DELETE/MERGE will break the stream unless you use options like skipChangeCommits.&lt;/P&gt;
&lt;P&gt;In DLT/SDP, streaming tables can only read from streaming/append‑only sources (Auto Loader, streaming tables, Delta tables used in append‑only mode). If the view’s query wraps an append‑only Delta table with allowed operators (projection, filters, certain joins, etc.), then the resulting streaming plan is still over an append‑only source.&lt;/P&gt;
&lt;P class="p8i6j01 paragraph"&gt;So, you're not really streaming from a view in the physical sense. You’re streaming from the append‑only Delta table(s) behind that view, with the view’s SQL simply applied on top of the streaming plan.&lt;/P&gt;
&lt;P class="p8i6j01 paragraph"&gt;Hope that answers your question.&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Mar 2026 15:09:23 GMT</pubDate>
    <dc:creator>Ashwin_DSA</dc:creator>
    <dc:date>2026-03-23T15:09:23Z</dc:date>
    <item>
      <title>Partition cols for a temporary table in Lakefow SDP</title>
      <link>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151617#M53670</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I was going through the documentation on quarantining records. Initially I thought that partitioning is not supported for temporary tables however I came cross the following&lt;/P&gt;&lt;LI-CODE lang="python"&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/25059"&gt;@DP&lt;/a&gt;.table(
  temporary=True,
  partition_cols=["is_quarantined"],
)
@dp.expect_all(rules)
def trips_data_quarantine():
  return (
    spark.readStream.table("raw_trips_data").withColumn("is_quarantined", expr(quarantine_rules))
  )&lt;/LI-CODE&gt;&lt;P&gt;I'm unable to understand how partitioning is been applied for a temporary table. Could anyone please explain this&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Mar 2026 10:08:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151617#M53670</guid>
      <dc:creator>IM_01</dc:creator>
      <dc:date>2026-03-22T10:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Partition cols for a temporary table in Lakefow SDP</title>
      <link>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151654#M53674</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/193958"&gt;@IM_01&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Good question. It's the terminology (temporary) that is probably causing the confusion.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Declarative Pipelines,&amp;nbsp;@dp.table(temporary=True, ...) creates a real Delta table on disk, just like a normal table.&amp;nbsp;The only difference is visibility. It is not published to Unity Catalog or the Hive Meta Store. It&amp;nbsp;is accessible only inside that pipeline. It also persists across pipeline runs for the lifetime of the pipeline, not just for a single run/session.&amp;nbsp;Because it’s still a proper Delta table under the hood, all the physical table features apply...&amp;nbsp;including partition_cols. The engine creates an internal table in the pipeline’s internal schema with the same partitioning as for a non‑temporary table. This is also explained in a technical blog&amp;nbsp;&lt;A href="https://community.databricks.com/t5/technical-blog/top-5-tips-to-build-delta-live-tables-dlt-pipelines-optimally/ba-p/83871" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;In your example,&amp;nbsp;trips_data_quarantine is a&amp;nbsp;physically partitioned Delta table on is_quarantined (so reads from it can prune on that column). This is private to the pipeline (not queryable from outside, not visible in UC) and is cleaned up when the pipeline is deleted.&lt;/P&gt;
&lt;P&gt;Partitioning is fully honoured. Temporary here means pipeline‑private, not ephemeral in-memory temp view.&lt;/P&gt;
&lt;P&gt;Does this answer your question?&lt;/P&gt;
&lt;P class="p1"&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Mar 2026 21:26:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151654#M53674</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-03-22T21:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Partition cols for a temporary table in Lakefow SDP</title>
      <link>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151701#M53686</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for the response&amp;nbsp; &amp;amp; for sharing the article.&lt;BR /&gt;&lt;BR /&gt;I was going through the article, had a doubt - view is a logical construct so it gives results when we read it and as per my knowledge a append-only source can be used as a source for streaming table just confused how we are able to use a &lt;STRONG&gt;view as a streaming source&lt;/STRONG&gt;. could you please explain this&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2026 10:51:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151701#M53686</guid>
      <dc:creator>IM_01</dc:creator>
      <dc:date>2026-03-23T10:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Partition cols for a temporary table in Lakefow SDP</title>
      <link>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151713#M53691</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/216690"&gt;@Ashwin_DSA&lt;/a&gt;&amp;nbsp; could you please help with above&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;sorry forgot to mention you above &amp;amp; unable to edit it&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2026 12:35:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151713#M53691</guid>
      <dc:creator>IM_01</dc:creator>
      <dc:date>2026-03-23T12:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Partition cols for a temporary table in Lakefow SDP</title>
      <link>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151729#M53695</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/193958"&gt;@IM_01&lt;/a&gt;,&lt;/P&gt;
&lt;P class="p8i6j01 paragraph"&gt;You’re correct on both points.&amp;nbsp;A view is purely logical, and a&amp;nbsp;streaming table still needs an append-only source. What makes this work is that streaming is applied to the underlying Delta tables, not to the view object itself.&lt;/P&gt;
&lt;P&gt;When you do STREAM(my_view) or spark.readStream.table("my_view"), Databricks expands the view definition (CREATE VIEW my_view AS SELECT ... FROM base_table ...) and builds a streaming plan directly over the base Delta table(s) that the view references.&amp;nbsp;In other words, it’s equivalent to copying the view’s SELECT into your streaming query. The fact that it’s called a view is just naming. The streaming engine still talks to the underlying Delta tables.&lt;/P&gt;
&lt;P&gt;The constraint "source must be append‑only" is checked on the Delta table behind the view, not on the view itself.&amp;nbsp;Structured Streaming only supports streaming from Delta tables if upstream writes are append‑only.&amp;nbsp; UPDATE/DELETE/MERGE will break the stream unless you use options like skipChangeCommits.&lt;/P&gt;
&lt;P&gt;In DLT/SDP, streaming tables can only read from streaming/append‑only sources (Auto Loader, streaming tables, Delta tables used in append‑only mode). If the view’s query wraps an append‑only Delta table with allowed operators (projection, filters, certain joins, etc.), then the resulting streaming plan is still over an append‑only source.&lt;/P&gt;
&lt;P class="p8i6j01 paragraph"&gt;So, you're not really streaming from a view in the physical sense. You’re streaming from the append‑only Delta table(s) behind that view, with the view’s SQL simply applied on top of the streaming plan.&lt;/P&gt;
&lt;P class="p8i6j01 paragraph"&gt;Hope that answers your question.&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2026 15:09:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151729#M53695</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-03-23T15:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Partition cols for a temporary table in Lakefow SDP</title>
      <link>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151745#M53700</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/216690"&gt;@Ashwin_DSA&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for the response&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;But in case of materialized view as a source for streaming table it should not work right but I see the pipeline is running without error. could you please help with this as the refresh rate can be full/incrmentral as per row_id tracking right.&lt;BR /&gt;Sorry for so many questions&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2026 19:05:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151745#M53700</guid>
      <dc:creator>IM_01</dc:creator>
      <dc:date>2026-03-23T19:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Partition cols for a temporary table in Lakefow SDP</title>
      <link>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151747#M53701</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/193958"&gt;@IM_01&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You’re right to be suspicious here... a materialized view is not a safe or supported source for a streaming table, even if your pipeline currently runs without errors.&lt;/P&gt;
&lt;P class="p8i6j01 paragraph"&gt;Streaming tables are built on Structured Streaming and assume the source is append‑only. New versions of the source table may only add rows. Existing rows are never changed. They only process new data since the last checkpoint and do not recompute history.&lt;/P&gt;
&lt;P class="p8i6j01 paragraph"&gt;Materialized views are maintained by Enzyme with batch semantics. On each refresh (incremental or full) they are free to update or delete existing rows in their backing Delta table to keep the result correct. A full refresh can even truncate and recompute everything.&lt;/P&gt;
&lt;P class="p8i6j01 paragraph"&gt;So if you do:&lt;/P&gt;
&lt;DIV class="l8rrz21 _1ibi0s3dn" data-ui-element="code-block-container"&gt;
&lt;PRE&gt;&lt;CODE class="markdown-code-sql p8i6j0e hljs language-sql _12n1b832"&gt;&lt;SPAN class="hljs-keyword"&gt;CREATE&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;OR&lt;/SPAN&gt; REFRESH STREAMING &lt;SPAN class="hljs-keyword"&gt;TABLE&lt;/SPAN&gt; st &lt;SPAN class="hljs-keyword"&gt;AS&lt;/SPAN&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; STREAM(my_mv);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV&gt;
&lt;DIV&gt;you get a mismatch...&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;From the streaming engine’s perspective, &lt;/SPAN&gt;&lt;SPAN&gt;my_mv&lt;/SPAN&gt;&lt;SPAN&gt; looks like a Delta table whose history can be rewritten by MV refresh.&amp;nbsp;&lt;/SPAN&gt;As soon as the MV performs non‑append changes (corrections, late data, full refresh), you either&amp;nbsp;&lt;SPAN&gt;hit a "&lt;/SPAN&gt;&lt;SPAN&gt;non‑append source"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;style failure, or&amp;nbsp;&lt;/SPAN&gt;silently lose corrections if you’ve enabled options that skip non‑append commits.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="p8i6j01 paragraph"&gt;The fact that your pipeline runs today usually just means the MV hasn’t yet done anything but pure appends. It’s not a pattern you should rely on.&lt;/P&gt;
&lt;P class="p8i6j01 paragraph"&gt;Hope this answers your question.&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;DIV class="l8rrz21 _1ibi0s3dn" data-ui-element="code-block-container"&gt;
&lt;DIV class="l8rrz23 _1ibi0s3d6 _1ibi0s332 _1ibi0s3do _1ibi0s3bm _1ibi0s3ce"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 23 Mar 2026 19:37:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151747#M53701</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-03-23T19:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Partition cols for a temporary table in Lakefow SDP</title>
      <link>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151792#M53709</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/216690"&gt;@Ashwin_DSA&lt;/a&gt;&amp;nbsp; So if we use view as a streaming source it can only reference a streaming table that are part of sdp pipeline or delta tables created outside the pipeline but not materialized views&lt;/P&gt;&lt;P&gt;And even a temporary view can be used as streaming source right.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2026 09:19:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151792#M53709</guid>
      <dc:creator>IM_01</dc:creator>
      <dc:date>2026-03-24T09:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Partition cols for a temporary table in Lakefow SDP</title>
      <link>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151800#M53710</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/193958"&gt;@IM_01&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You can stream from views (including SDP temporary views) as long as those views ultimately sit on append‑only streaming/Delta tables. Using a materialized view as the base is not supported. MV refresh can rewrite history (updates/deletes), breaking the append‑only contract that streaming tables rely on, even if your pipeline currently runs without errors.&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2026 10:13:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151800#M53710</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-03-24T10:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Partition cols for a temporary table in Lakefow SDP</title>
      <link>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151804#M53711</link>
      <description>&lt;P&gt;Thanks Ashwin&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2026 10:25:17 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/partition-cols-for-a-temporary-table-in-lakefow-sdp/m-p/151804#M53711</guid>
      <dc:creator>IM_01</dc:creator>
      <dc:date>2026-03-24T10:25:17Z</dc:date>
    </item>
  </channel>
</rss>

