<?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 Error in SQL statement: SparkFatalException. How to fix it? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/error-in-sql-statement-sparkfatalexception-how-to-fix-it/m-p/22477#M15396</link>
    <description>&lt;P&gt;When i try to execute sql query(2 joins) i get below message: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;com.databricks.backend.common.rpc.DatabricksExceptions$SQLExecutionException: org.apache.spark.util.SparkFatalException
	at org.apache.spark.sql.execution.exchange.BroadcastExchangeExec.$anonfun$relationFuture$1(BroadcastExchangeExec.scala:212)
	at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:958)
	at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$4(SQLExecution.scala:418)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
	at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$3(SQLExecution.scala:418)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
	at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$2(SQLExecution.scala:417)
	at org.apache.spark.sql.execution.SQLExecution$.withOptimisticTransaction(SQLExecution.scala:435)
	at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$1(SQLExecution.scala:416)
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
	at org.apache.spark.util.threads.SparkThreadLocalCapturingRunnable.$anonfun$run$1(SparkThreadLocalForwardingThreadPoolExecutor.scala:104)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at org.apache.spark.util.threads.SparkThreadLocalCapturingHelper.runWithCaptured(SparkThreadLocalForwardingThreadPoolExecutor.scala:68)
	at org.apache.spark.util.threads.SparkThreadLocalCapturingHelper.runWithCaptured$(SparkThreadLocalForwardingThreadPoolExecutor.scala:54)
	at org.apache.spark.util.threads.SparkThreadLocalCapturingRunnable.runWithCaptured(SparkThreadLocalForwardingThreadPoolExecutor.scala:101)
	at org.apache.spark.util.threads.SparkThreadLocalCapturingRunnable.run(SparkThreadLocalForwardingThreadPoolExecutor.scala:104)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
&amp;nbsp;
	at com.databricks.backend.daemon.driver.SQLDriverLocal.executeSql(SQLDriverLocal.scala:130)
	at com.databricks.backend.daemon.driver.SQLDriverLocal.repl(SQLDriverLocal.scala:145)
	at com.databricks.backend.daemon.driver.DriverLocal.$anonfun$execute$11(DriverLocal.scala:602)
	at com.databricks.logging.Log4jUsageLoggingShim$.$anonfun$withAttributionContext$1(Log4jUsageLoggingShim.scala:28)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
	at com.databricks.logging.AttributionContext$.withValue(AttributionContext.scala:94)
	at com.databricks.logging.Log4jUsageLoggingShim$.withAttributionContext(Log4jUsageLoggingShim.scala:26)
	at com.databricks.logging.UsageLogging.withAttributionContext(UsageLogging.scala:205)
	at com.databricks.logging.UsageLogging.withAttributionContext$(UsageLogging.scala:204)
	at com.databricks.backend.daemon.driver.DriverLocal.withAttributionContext(DriverLocal.scala:60)
	at com.databricks.logging.UsageLogging.withAttributionTags(UsageLogging.scala:240)
	at com.databricks.logging.UsageLogging.withAttributionTags$(UsageLogging.scala:225)
	at com.databricks.backend.daemon.driver.DriverLocal.withAttributionTags(DriverLocal.scala:60)
	at com.databricks.backend.daemon.driver.DriverLocal.execute(DriverLocal.scala:579)
	at com.databricks.backend.daemon.driver.DriverWrapper.$anonfun$tryExecutingCommand$1(DriverWrapper.scala:615)
	at scala.util.Try$.apply(Try.scala:213)
	at com.databricks.backend.daemon.driver.DriverWrapper.tryExecutingCommand(DriverWrapper.scala:607)
	at com.databricks.backend.daemon.driver.DriverWrapper.executeCommandAndGetError(DriverWrapper.scala:526)
	at com.databricks.backend.daemon.driver.DriverWrapper.executeCommand(DriverWrapper.scala:561)
	at com.databricks.backend.daemon.driver.DriverWrapper.runInnerLoop(DriverWrapper.scala:431)
	at com.databricks.backend.daemon.driver.DriverWrapper.runInner(DriverWrapper.scala:374)
	at com.databricks.backend.daemon.driver.DriverWrapper.run(DriverWrapper.scala:225)
	at java.lang.Thread.run(Thread.java:748)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How to fix it? Any ideas? &lt;/P&gt;</description>
    <pubDate>Thu, 21 Apr 2022 07:48:00 GMT</pubDate>
    <dc:creator>ernijed</dc:creator>
    <dc:date>2022-04-21T07:48:00Z</dc:date>
    <item>
      <title>Error in SQL statement: SparkFatalException. How to fix it?</title>
      <link>https://community.databricks.com/t5/data-engineering/error-in-sql-statement-sparkfatalexception-how-to-fix-it/m-p/22477#M15396</link>
      <description>&lt;P&gt;When i try to execute sql query(2 joins) i get below message: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;com.databricks.backend.common.rpc.DatabricksExceptions$SQLExecutionException: org.apache.spark.util.SparkFatalException
	at org.apache.spark.sql.execution.exchange.BroadcastExchangeExec.$anonfun$relationFuture$1(BroadcastExchangeExec.scala:212)
	at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:958)
	at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$4(SQLExecution.scala:418)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
	at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$3(SQLExecution.scala:418)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
	at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$2(SQLExecution.scala:417)
	at org.apache.spark.sql.execution.SQLExecution$.withOptimisticTransaction(SQLExecution.scala:435)
	at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$1(SQLExecution.scala:416)
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
	at org.apache.spark.util.threads.SparkThreadLocalCapturingRunnable.$anonfun$run$1(SparkThreadLocalForwardingThreadPoolExecutor.scala:104)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at org.apache.spark.util.threads.SparkThreadLocalCapturingHelper.runWithCaptured(SparkThreadLocalForwardingThreadPoolExecutor.scala:68)
	at org.apache.spark.util.threads.SparkThreadLocalCapturingHelper.runWithCaptured$(SparkThreadLocalForwardingThreadPoolExecutor.scala:54)
	at org.apache.spark.util.threads.SparkThreadLocalCapturingRunnable.runWithCaptured(SparkThreadLocalForwardingThreadPoolExecutor.scala:101)
	at org.apache.spark.util.threads.SparkThreadLocalCapturingRunnable.run(SparkThreadLocalForwardingThreadPoolExecutor.scala:104)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
&amp;nbsp;
	at com.databricks.backend.daemon.driver.SQLDriverLocal.executeSql(SQLDriverLocal.scala:130)
	at com.databricks.backend.daemon.driver.SQLDriverLocal.repl(SQLDriverLocal.scala:145)
	at com.databricks.backend.daemon.driver.DriverLocal.$anonfun$execute$11(DriverLocal.scala:602)
	at com.databricks.logging.Log4jUsageLoggingShim$.$anonfun$withAttributionContext$1(Log4jUsageLoggingShim.scala:28)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
	at com.databricks.logging.AttributionContext$.withValue(AttributionContext.scala:94)
	at com.databricks.logging.Log4jUsageLoggingShim$.withAttributionContext(Log4jUsageLoggingShim.scala:26)
	at com.databricks.logging.UsageLogging.withAttributionContext(UsageLogging.scala:205)
	at com.databricks.logging.UsageLogging.withAttributionContext$(UsageLogging.scala:204)
	at com.databricks.backend.daemon.driver.DriverLocal.withAttributionContext(DriverLocal.scala:60)
	at com.databricks.logging.UsageLogging.withAttributionTags(UsageLogging.scala:240)
	at com.databricks.logging.UsageLogging.withAttributionTags$(UsageLogging.scala:225)
	at com.databricks.backend.daemon.driver.DriverLocal.withAttributionTags(DriverLocal.scala:60)
	at com.databricks.backend.daemon.driver.DriverLocal.execute(DriverLocal.scala:579)
	at com.databricks.backend.daemon.driver.DriverWrapper.$anonfun$tryExecutingCommand$1(DriverWrapper.scala:615)
	at scala.util.Try$.apply(Try.scala:213)
	at com.databricks.backend.daemon.driver.DriverWrapper.tryExecutingCommand(DriverWrapper.scala:607)
	at com.databricks.backend.daemon.driver.DriverWrapper.executeCommandAndGetError(DriverWrapper.scala:526)
	at com.databricks.backend.daemon.driver.DriverWrapper.executeCommand(DriverWrapper.scala:561)
	at com.databricks.backend.daemon.driver.DriverWrapper.runInnerLoop(DriverWrapper.scala:431)
	at com.databricks.backend.daemon.driver.DriverWrapper.runInner(DriverWrapper.scala:374)
	at com.databricks.backend.daemon.driver.DriverWrapper.run(DriverWrapper.scala:225)
	at java.lang.Thread.run(Thread.java:748)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How to fix it? Any ideas? &lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 07:48:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-in-sql-statement-sparkfatalexception-how-to-fix-it/m-p/22477#M15396</guid>
      <dc:creator>ernijed</dc:creator>
      <dc:date>2022-04-21T07:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error in SQL statement: SparkFatalException. How to fix it?</title>
      <link>https://community.databricks.com/t5/data-engineering/error-in-sql-statement-sparkfatalexception-how-to-fix-it/m-p/22478#M15397</link>
      <description>&lt;P&gt;@Erni Jed​&amp;nbsp;, Please share examples of your data and your code.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 09:34:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-in-sql-statement-sparkfatalexception-how-to-fix-it/m-p/22478#M15397</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-04-21T09:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error in SQL statement: SparkFatalException. How to fix it?</title>
      <link>https://community.databricks.com/t5/data-engineering/error-in-sql-statement-sparkfatalexception-how-to-fix-it/m-p/22479#M15398</link>
      <description>&lt;P&gt;@Hubert Dudek​&amp;nbsp;, SQL Code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select 
  c.client_id
  ,c.birth_date
  ,a.contract_prod_id
  ,a.contract_id
  ,a.contract_number
  ,a.mig_contract_number
  ,a.contract_amount
  ,a.ref_number
  ,a.status
  ,p.product_type
from clients c
left join contracts a
on a.contract_client_id = c.client_id
left join products p
on p.product_id = a.product_id&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Data sample:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="sample_data"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1944i7A0FC4432B99CF13/image-size/large?v=v2&amp;amp;px=999" role="button" title="sample_data" alt="sample_data" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 13:40:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-in-sql-statement-sparkfatalexception-how-to-fix-it/m-p/22479#M15398</guid>
      <dc:creator>ernijed</dc:creator>
      <dc:date>2022-04-22T13:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Error in SQL statement: SparkFatalException. How to fix it?</title>
      <link>https://community.databricks.com/t5/data-engineering/error-in-sql-statement-sparkfatalexception-how-to-fix-it/m-p/22480#M15399</link>
      <description>&lt;P&gt;@Erni Jed​&amp;nbsp;, I tested, and your query is ok. So it has to be some other issue. Maybe you could try it on a smaller data set. Please analyze/debug also using SPARK UI.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 18:05:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-in-sql-statement-sparkfatalexception-how-to-fix-it/m-p/22480#M15399</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-04-25T18:05:31Z</dc:date>
    </item>
  </channel>
</rss>

