<?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: Dataframe getting updated after creating temporary view in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/dataframe-getting-updated-after-creating-temporary-view/m-p/120025#M46031</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/139768"&gt;@Einsatz&lt;/a&gt;,&amp;nbsp;this is expected in DBR version 14.3 and above since we don't have a Spark context. This is happening due to the cache invalidation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To resolve the issue, please go with the dynamic name for the view every time.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 May 2025 05:27:46 GMT</pubDate>
    <dc:creator>nikhilj0421</dc:creator>
    <dc:date>2025-05-23T05:27:46Z</dc:date>
    <item>
      <title>Dataframe getting updated after creating temporary view</title>
      <link>https://community.databricks.com/t5/data-engineering/dataframe-getting-updated-after-creating-temporary-view/m-p/119619#M45930</link>
      <description>&lt;P&gt;I'm observing different behavior between Databricks Runtime versions when working with DataFrames and temporary views, and would appreciate any clarification.&lt;/P&gt;&lt;P&gt;In both environments, I performed the following steps in a notebook (each connected to its own cluster):&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;transformed_df.createOrReplaceTempView("source_vw")&lt;/LI&gt;&lt;LI&gt;{few transformations}&lt;/LI&gt;&lt;LI&gt;transformed_df.count()&lt;/LI&gt;&lt;LI&gt;transformed_df.createOrReplaceTempView("source_vw")&lt;/LI&gt;&lt;LI&gt;transformed_df.count()&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;The transformations (step 2) involve modifying the same DataFrame (transformed_df), and at certain points, a temporary view is created using the same name (transformed_df).&lt;/P&gt;&lt;P&gt;In DBR 15.4, reusing the same name for the DataFrame and temporary view doesn't appear to overwrite the dataframes or temporary view as expected.&lt;/P&gt;&lt;P&gt;Behavior:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In DBR 13.3 LTS, the results from Step 3 and Step 5 are identical (which is expected).&lt;/LI&gt;&lt;LI&gt;In DBR 15.4 LTS, the result from Step 5 is different than Step 3.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;To clarify, there were no writes or modifications to the underlying Delta table between the two counts. I’m just calling createOrReplaceTempView() a second time.&lt;/P&gt;&lt;P&gt;Attached images for reference.&lt;/P&gt;&lt;P&gt;Thanks in advance for any insight or references to release notes that could help explain this behavior.&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 12:20:17 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dataframe-getting-updated-after-creating-temporary-view/m-p/119619#M45930</guid>
      <dc:creator>Einsatz</dc:creator>
      <dc:date>2025-05-19T12:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dataframe getting updated after creating temporary view</title>
      <link>https://community.databricks.com/t5/data-engineering/dataframe-getting-updated-after-creating-temporary-view/m-p/120025#M46031</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/139768"&gt;@Einsatz&lt;/a&gt;,&amp;nbsp;this is expected in DBR version 14.3 and above since we don't have a Spark context. This is happening due to the cache invalidation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To resolve the issue, please go with the dynamic name for the view every time.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 05:27:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/dataframe-getting-updated-after-creating-temporary-view/m-p/120025#M46031</guid>
      <dc:creator>nikhilj0421</dc:creator>
      <dc:date>2025-05-23T05:27:46Z</dc:date>
    </item>
  </channel>
</rss>

