<?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: Internal Error During Spark SQL Phase Optimization – Possible Bug in Spark/Databricks Runtime in Warehousing &amp; Analytics</title>
    <link>https://community.databricks.com/t5/warehousing-analytics/internal-error-during-spark-sql-phase-optimization-possible-bug/m-p/101110#M1736</link>
    <description>&lt;P&gt;This is not expected. Can you please verify:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Are there any &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/admin/sql/" target="_self"&gt;admin settings&lt;/A&gt; set on the cluster?&lt;/LI&gt;
&lt;LI&gt;Are you selecting from any views? If so, what do their definitions look like?&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Thu, 05 Dec 2024 17:05:09 GMT</pubDate>
    <dc:creator>cgrant</dc:creator>
    <dc:date>2024-12-05T17:05:09Z</dc:date>
    <item>
      <title>Internal Error During Spark SQL Phase Optimization – Possible Bug in Spark/Databricks Runtime</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/internal-error-during-spark-sql-phase-optimization-possible-bug/m-p/88834#M1527</link>
      <description>&lt;DIV class=""&gt;We are experiencing the following issues.&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;H4&gt;&lt;STRONG&gt;Description:&lt;/STRONG&gt;&lt;/H4&gt;&lt;P&gt;I encountered an issue while executing a Spark SQL query in Databricks, and it seems to be related to the query optimization phase. The error message suggests an internal bug within Spark or the Spark plugins used in our environment. I am reaching out to report this issue and seek assistance in troubleshooting and resolving it.&lt;/P&gt;&lt;H4&gt;&lt;STRONG&gt;Error Message:&lt;/STRONG&gt;&lt;/H4&gt;&lt;DIV&gt;&lt;DIV&gt;[INTERNAL_ERROR] The Spark &lt;SPAN&gt;SQL&lt;/SPAN&gt; phase optimization failed &lt;SPAN&gt;with&lt;/SPAN&gt; an internal error. You hit a bug &lt;SPAN&gt;in&lt;/SPAN&gt; Spark &lt;SPAN&gt;or&lt;/SPAN&gt; the Spark plugins you use. Please, report this bug &lt;SPAN&gt;to&lt;/SPAN&gt; the &lt;SPAN&gt;corresponding&lt;/SPAN&gt; communities &lt;SPAN&gt;or&lt;/SPAN&gt; vendors, &lt;SPAN&gt;and&lt;/SPAN&gt; provide the &lt;SPAN&gt;full&lt;/SPAN&gt; stack trace. &lt;SPAN&gt;SQLSTATE&lt;/SPAN&gt;: XX000&lt;/DIV&gt;&lt;/DIV&gt;&lt;H4&gt;&lt;STRONG&gt;Environment Details:&lt;/STRONG&gt;&lt;/H4&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;Cloud: Azure&lt;/LI&gt;&lt;LI&gt;Compute: SQL Warehouse, Serverless&lt;/LI&gt;&lt;LI&gt;Channel:&amp;nbsp;(v 2024.35)&lt;/LI&gt;&lt;LI&gt;Size: X-Small&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;H4&gt;&lt;STRONG&gt;Query:&lt;/STRONG&gt;&lt;/H4&gt;&lt;P&gt;Here is the SQL query that triggered the internal error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;WITH&lt;/SPAN&gt; isos &lt;SPAN&gt;AS&lt;/SPAN&gt; ( &lt;SPAN&gt;SELECT&lt;/SPAN&gt; &lt;SPAN&gt;DISTINCT&lt;/SPAN&gt; Name &lt;SPAN&gt;AS&lt;/SPAN&gt; full_name, &lt;SPAN&gt;CAST&lt;/SPAN&gt;(RecordingTime &lt;SPAN&gt;AS&lt;/SPAN&gt; &lt;SPAN&gt;DATE&lt;/SPAN&gt;) &lt;SPAN&gt;AS&lt;/SPAN&gt; test_date, &lt;SPAN&gt;LOWER&lt;/SPAN&gt;(TestType) &lt;SPAN&gt;AS&lt;/SPAN&gt; test_type, TestTypeName, &lt;SPAN&gt;CASE&lt;/SPAN&gt; &lt;SPAN&gt;WHEN&lt;/SPAN&gt; &lt;SPAN&gt;LOWER&lt;/SPAN&gt;(TestTypeName) &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;'slppf'&lt;/SPAN&gt; &lt;SPAN&gt;OR&lt;/SPAN&gt; &lt;SPAN&gt;LOWER&lt;/SPAN&gt;(TestType) &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;'rsaip'&lt;/SPAN&gt; &lt;SPAN&gt;THEN&lt;/SPAN&gt; &lt;SPAN&gt;'ankle iso push'&lt;/SPAN&gt; &lt;SPAN&gt;WHEN&lt;/SPAN&gt; &lt;SPAN&gt;LOWER&lt;/SPAN&gt;(TestTypeName) &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;'slsquat'&lt;/SPAN&gt; &lt;SPAN&gt;OR&lt;/SPAN&gt; &lt;SPAN&gt;LOWER&lt;/SPAN&gt;(TestType) &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;'rskip'&lt;/SPAN&gt; &lt;SPAN&gt;THEN&lt;/SPAN&gt; &lt;SPAN&gt;'knee iso push'&lt;/SPAN&gt; &lt;SPAN&gt;WHEN&lt;/SPAN&gt; &lt;SPAN&gt;LOWER&lt;/SPAN&gt;(TestTypeName) &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;'slhipext'&lt;/SPAN&gt; &lt;SPAN&gt;OR&lt;/SPAN&gt; &lt;SPAN&gt;LOWER&lt;/SPAN&gt;(TestType) &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;'rship'&lt;/SPAN&gt; &lt;SPAN&gt;THEN&lt;/SPAN&gt; &lt;SPAN&gt;'hip iso push'&lt;/SPAN&gt; &lt;SPAN&gt;ELSE&lt;/SPAN&gt; &lt;SPAN&gt;LOWER&lt;/SPAN&gt;(TestTypeName) &lt;SPAN&gt;END&lt;/SPAN&gt; &lt;SPAN&gt;AS&lt;/SPAN&gt; test_type_name, Limb, `Peak Vertical Force &lt;SPAN&gt;/&lt;/SPAN&gt; BW` &lt;SPAN&gt;AS&lt;/SPAN&gt; peak_vertical_force &lt;SPAN&gt;FROM&lt;/SPAN&gt; &amp;lt;catalog&amp;gt;.&amp;lt;schema&amp;gt;.&amp;lt;table&amp;gt; ), isos_next &lt;SPAN&gt;AS&lt;/SPAN&gt; ( &lt;SPAN&gt;SELECT&lt;/SPAN&gt; &lt;SPAN&gt;*&lt;/SPAN&gt; &lt;SPAN&gt;FROM&lt;/SPAN&gt; isos&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;WHERE test_type_name = 'hip iso push' &amp;nbsp;&lt;/SPAN&gt; ) &lt;SPAN&gt;SELECT&lt;/SPAN&gt; &lt;SPAN&gt;*&lt;/SPAN&gt; &lt;SPAN&gt;FROM&lt;/SPAN&gt; isos_next;&lt;/DIV&gt;&lt;/DIV&gt;&lt;H4&gt;&lt;STRONG&gt;Steps to Reproduce:&lt;/STRONG&gt;&lt;/H4&gt;&lt;OL&gt;&lt;LI&gt;Executed the above SQL query within a Databricks notebook.&lt;/LI&gt;&lt;LI&gt;The error occurs during query execution, specifically during the Spark SQL optimization phase.&lt;/LI&gt;&lt;/OL&gt;&lt;H4&gt;&lt;STRONG&gt;Troubleshooting Attempts:&lt;/STRONG&gt;&lt;/H4&gt;&lt;UL&gt;&lt;LI&gt;I simplified the query to isolate the issue, and it appears to be related to the internal Spark SQL optimizer.&lt;/LI&gt;&lt;LI&gt;I've checked for any unsupported functions or potential syntax issues, but the query seems valid based on Spark SQL syntax.&lt;/LI&gt;&lt;/UL&gt;&lt;H4&gt;&lt;STRONG&gt;Request:&lt;/STRONG&gt;&lt;/H4&gt;&lt;P&gt;I believe this may be a bug in Spark or the Databricks runtime, and I would appreciate guidance on resolving it. If further investigation is required, I am happy to provide any additional details or logs.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 06 Sep 2024 08:02:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/internal-error-during-spark-sql-phase-optimization-possible-bug/m-p/88834#M1527</guid>
      <dc:creator>boitumelodikoko</dc:creator>
      <dc:date>2024-09-06T08:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Error During Spark SQL Phase Optimization – Possible Bug in Spark/Databricks Runtime</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/internal-error-during-spark-sql-phase-optimization-possible-bug/m-p/101110#M1736</link>
      <description>&lt;P&gt;This is not expected. Can you please verify:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Are there any &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/admin/sql/" target="_self"&gt;admin settings&lt;/A&gt; set on the cluster?&lt;/LI&gt;
&lt;LI&gt;Are you selecting from any views? If so, what do their definitions look like?&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 05 Dec 2024 17:05:09 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/internal-error-during-spark-sql-phase-optimization-possible-bug/m-p/101110#M1736</guid>
      <dc:creator>cgrant</dc:creator>
      <dc:date>2024-12-05T17:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Error During Spark SQL Phase Optimization – Possible Bug in Spark/Databricks Runtime</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/internal-error-during-spark-sql-phase-optimization-possible-bug/m-p/106411#M1823</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Update:&lt;BR /&gt;&lt;/STRONG&gt;Response from the Databricks Team.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;Symptoms&lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;Internal Error During Spark SQL Phase Optimization.&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;Cause&lt;BR /&gt;&lt;/STRONG&gt;DataBricks PG Engineering team confirmed that this is indeed a bug in CASE WHEN optimization &amp;amp; they are working on the fix for this issue.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resolution&lt;BR /&gt;&lt;/STRONG&gt;The fix has been merged and it will soon be available in runtime. Once merged, we await the deployment of version 16.1.&amp;nbsp;The ETA for the fix for this issue with the new DBR 16.1 is mid-January.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 08:25:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/internal-error-during-spark-sql-phase-optimization-possible-bug/m-p/106411#M1823</guid>
      <dc:creator>boitumelodikoko</dc:creator>
      <dc:date>2025-01-21T08:25:57Z</dc:date>
    </item>
  </channel>
</rss>

