<?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 Usability bug in SPARKSQL in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/usability-bug-in-sparksql/m-p/118986#M10018</link>
    <description>&lt;P&gt;Hi Databricks &amp;amp; Team,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Spark Cluster: 16.3&lt;/P&gt;&lt;P&gt;Being a databricks partner I am unable to raise a support ticket, hence am positing this here.&amp;nbsp;&lt;BR /&gt;pyspark is good in rendering multiple results in a single cell. refer screenshot below&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vchandm23_0-1747102508257.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/16785i5DD8C9CC8772EA86/image-size/large?v=v2&amp;amp;px=999" role="button" title="vchandm23_0-1747102508257.png" alt="vchandm23_0-1747102508257.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(Screenshot 1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;However, SPARKSQL in the notebook is not working as above: Refer screenshot below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vchandm23_1-1747102657425.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/16786i431FAE3AE2F19564/image-size/large?v=v2&amp;amp;px=999" role="button" title="vchandm23_1-1747102657425.png" alt="vchandm23_1-1747102657425.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(Screenshot 2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Expected behaviour: SParkSQL in notebook must (return or display) 2 table results like in pyspark screenshot (1).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;/P&gt;&lt;P&gt;vchandm23&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 May 2025 02:23:14 GMT</pubDate>
    <dc:creator>vchandm23</dc:creator>
    <dc:date>2025-05-13T02:23:14Z</dc:date>
    <item>
      <title>Usability bug in SPARKSQL</title>
      <link>https://community.databricks.com/t5/get-started-discussions/usability-bug-in-sparksql/m-p/118986#M10018</link>
      <description>&lt;P&gt;Hi Databricks &amp;amp; Team,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Spark Cluster: 16.3&lt;/P&gt;&lt;P&gt;Being a databricks partner I am unable to raise a support ticket, hence am positing this here.&amp;nbsp;&lt;BR /&gt;pyspark is good in rendering multiple results in a single cell. refer screenshot below&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vchandm23_0-1747102508257.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/16785i5DD8C9CC8772EA86/image-size/large?v=v2&amp;amp;px=999" role="button" title="vchandm23_0-1747102508257.png" alt="vchandm23_0-1747102508257.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(Screenshot 1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;However, SPARKSQL in the notebook is not working as above: Refer screenshot below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vchandm23_1-1747102657425.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/16786i431FAE3AE2F19564/image-size/large?v=v2&amp;amp;px=999" role="button" title="vchandm23_1-1747102657425.png" alt="vchandm23_1-1747102657425.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(Screenshot 2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Expected behaviour: SParkSQL in notebook must (return or display) 2 table results like in pyspark screenshot (1).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;/P&gt;&lt;P&gt;vchandm23&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 02:23:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/usability-bug-in-sparksql/m-p/118986#M10018</guid>
      <dc:creator>vchandm23</dc:creator>
      <dc:date>2025-05-13T02:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Usability bug in SPARKSQL</title>
      <link>https://community.databricks.com/t5/get-started-discussions/usability-bug-in-sparksql/m-p/138486#M10988</link>
      <description>&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Databricks notebooks currently support multiple outputs per cell in Python (pyspark) but do not provide the same behavior for SQL cells. When running several SQL statements in a single notebook cell, Databricks will only render the output from the last statement. This is a known limitation and has been discussed by both users and Databricks documentation.​&lt;/P&gt;
&lt;H2 id="pyspark-vs-sparksql-output-behavior" class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0 md:text-lg [hr+&amp;amp;]:mt-4"&gt;Pyspark vs SparkSQL Output Behavior&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Python and pyspark cells can show multiple results (e.g., using repeated&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;display()&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or returning multiple values).&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;SQL cells, including those using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;%sql&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;magic, only display the last statement's output. Earlier results are not rendered in the cell output.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 id="workarounds" class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0 md:text-lg [hr+&amp;amp;]:mt-4"&gt;Workarounds&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;To see results for multiple SQL queries, put each query in a separate cell.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;For complex workflows, you can execute multiple queries from a single Python cell, capture results with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;spark.sql()&lt;/CODE&gt;, and use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;display()&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;on each DataFrame.​&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;There is no built-in option to have native SQL notebook cells output multiple tables in-line, as shown in pyspark, as of Databricks Runtime 16.3.​&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 id="expected-behavior" class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0 md:text-lg [hr+&amp;amp;]:mt-4"&gt;Expected Behavior&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;The current behavior—where only the last SQL query’s result is displayed from a notebook SQL cell—is the expected design in Databricks. Multiple result sets in one SQL cell for SparkSQL are not currently supported like they are for pyspark.​&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If your notebooks require displaying multiple tables at once, the recommended solution is to use Python with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;spark.sql()&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for each query or use multiple SQL cells. There is no configuration or workaround to enable multiple SparkSQL table results from a single SQL cell as you hoped.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2025 01:28:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/usability-bug-in-sparksql/m-p/138486#M10988</guid>
      <dc:creator>mark_ott</dc:creator>
      <dc:date>2025-11-11T01:28:42Z</dc:date>
    </item>
  </channel>
</rss>

