<?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: Temporary view in a different cell in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Temporary-view-in-a-different-cell/m-p/4713253#M9764</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/582610"&gt;@ebjim&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;Thanks for reaching out to the Microsoft fabric community forum.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Spark notebooks commonly show this behavior when working with temporary views across multiple cells. These views are only available within the Spark session in which they were created. In Microsoft Fabric, if a new session starts (which can happen between cell executions), the temporary views are no longer available which is likely why you're seeing the “View or Table not found” error in the next cell.&lt;/P&gt;
&lt;P&gt;To keep things working:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Create and use the temporary view within the same cell, or&lt;/LI&gt;
&lt;LI&gt;Consider using a global temporary view if you need to access it across cells or sessions.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If you'd like more detail on how notebook execution and Spark sessions work in Fabric, this Microsoft Learn article is a great resource:&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-engineering/author-execute-notebook#magic-commands-in-a-notebook" target="_blank"&gt;Develop, execute, and manage notebooks - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;If this post was helpful, please give us Kudos and consider marking &lt;STRONG&gt;Accept as solution&lt;/STRONG&gt; to assist other members in finding it more easily.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;Best Regards,&amp;nbsp;&lt;BR /&gt;Menaka.&lt;BR /&gt;Community Support Team&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 30 May 2025 05:14:49 GMT</pubDate>
    <dc:creator>v-menakakota</dc:creator>
    <dc:date>2025-05-30T05:14:49Z</dc:date>
    <item>
      <title>Temporary view in a different cell</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Temporary-view-in-a-different-cell/m-p/4713085#M9761</link>
      <description>&lt;P&gt;I have a temporary view created in a cell, which is called in the next cell.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%%sql&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CREATE OR REPLACE TEMPORARY VIEW vtemp AS&lt;/P&gt;&lt;P&gt;SELECT NAME, CITY&amp;nbsp;&lt;/P&gt;&lt;P&gt;FROM table1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; com.microsoft.spark.fabric&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt; com.microsoft.spark.fabric.Constants &lt;/SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; Constants&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt; &lt;SPAN&gt;pyspark&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt; &lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;functions&lt;/SPAN&gt; &lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;F&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt; &lt;SPAN&gt;pyspark&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt; &lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;SparkSession&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt; &lt;SPAN&gt;pyspark&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;types&lt;/SPAN&gt; &lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;IntegerType&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;StructType&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;StructField&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;StringType&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;DecimalType&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;DateType&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt; &lt;SPAN&gt;pyspark&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;functions&lt;/SPAN&gt; &lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;make_date&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;df&lt;/SPAN&gt;&lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;spark&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt;("&lt;/SPAN&gt;&lt;SPAN&gt;SELECT&lt;/SPAN&gt;&lt;SPAN&gt; Name&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;FROM&lt;/SPAN&gt;&lt;SPAN&gt; vtemp")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;When I create the view in the same cell (using PySpark), no problem. If I do it in the first (separate) cell, whether it's using Spark SQL and PySpark, I get the View or Table Not Found error. What am I doing wrong?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 30 May 2025 00:42:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Temporary-view-in-a-different-cell/m-p/4713085#M9761</guid>
      <dc:creator>ebjim</dc:creator>
      <dc:date>2025-05-30T00:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Temporary view in a different cell</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Temporary-view-in-a-different-cell/m-p/4713253#M9764</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/582610"&gt;@ebjim&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;Thanks for reaching out to the Microsoft fabric community forum.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Spark notebooks commonly show this behavior when working with temporary views across multiple cells. These views are only available within the Spark session in which they were created. In Microsoft Fabric, if a new session starts (which can happen between cell executions), the temporary views are no longer available which is likely why you're seeing the “View or Table not found” error in the next cell.&lt;/P&gt;
&lt;P&gt;To keep things working:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Create and use the temporary view within the same cell, or&lt;/LI&gt;
&lt;LI&gt;Consider using a global temporary view if you need to access it across cells or sessions.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If you'd like more detail on how notebook execution and Spark sessions work in Fabric, this Microsoft Learn article is a great resource:&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-engineering/author-execute-notebook#magic-commands-in-a-notebook" target="_blank"&gt;Develop, execute, and manage notebooks - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;If this post was helpful, please give us Kudos and consider marking &lt;STRONG&gt;Accept as solution&lt;/STRONG&gt; to assist other members in finding it more easily.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;Best Regards,&amp;nbsp;&lt;BR /&gt;Menaka.&lt;BR /&gt;Community Support Team&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 05:14:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Temporary-view-in-a-different-cell/m-p/4713253#M9764</guid>
      <dc:creator>v-menakakota</dc:creator>
      <dc:date>2025-05-30T05:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Temporary view in a different cell</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Temporary-view-in-a-different-cell/m-p/4714295#M9785</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/882994"&gt;@v-menakakota&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the helpful response. I do want to ask: how do you create temporary global views in Fabric? Lakehouses and warehouses don't support that.&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 14:32:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Temporary-view-in-a-different-cell/m-p/4714295#M9785</guid>
      <dc:creator>ebjim</dc:creator>
      <dc:date>2025-05-30T14:32:09Z</dc:date>
    </item>
  </channel>
</rss>

