<?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 How to stop SparkSession within notebook without errr in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-stop-sparksession-within-notebook-without-errr/m-p/36157#M26060</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I want to run an ETL job and when the job ends&amp;nbsp;&lt;/SPAN&gt;I would like to stop SparkSession to free my cluster's resources, by doing this I could avoid restarting the cluster, but when calling&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;spark.stop()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the job returns with status &lt;STRONG&gt;failed &lt;/STRONG&gt;even though it has finished successfully, since the notebook automatically detach and the following error occurs:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The spark context has stopped and the driver is restarting. Your notebook will be automatically reattached.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I have read in &lt;A href="https://community.databricks.com/t5/data-engineering/few-things-you-should-not-do-in-databricks/m-p/20866#M14127" target="_self"&gt;this community's post&lt;/A&gt; that stopping the spark session is not recommended, but I do not understand the reason behind this. As far as I know, it is recommended to end the spark session after finishing the job in order the JVMs to close and free the resources.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a recommended way to stop/restart SparkSession in a databricks job?&lt;/P&gt;</description>
    <pubDate>Thu, 29 Jun 2023 10:02:28 GMT</pubDate>
    <dc:creator>gkrilis</dc:creator>
    <dc:date>2023-06-29T10:02:28Z</dc:date>
    <item>
      <title>How to stop SparkSession within notebook without errr</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-stop-sparksession-within-notebook-without-errr/m-p/36157#M26060</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I want to run an ETL job and when the job ends&amp;nbsp;&lt;/SPAN&gt;I would like to stop SparkSession to free my cluster's resources, by doing this I could avoid restarting the cluster, but when calling&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;spark.stop()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the job returns with status &lt;STRONG&gt;failed &lt;/STRONG&gt;even though it has finished successfully, since the notebook automatically detach and the following error occurs:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The spark context has stopped and the driver is restarting. Your notebook will be automatically reattached.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I have read in &lt;A href="https://community.databricks.com/t5/data-engineering/few-things-you-should-not-do-in-databricks/m-p/20866#M14127" target="_self"&gt;this community's post&lt;/A&gt; that stopping the spark session is not recommended, but I do not understand the reason behind this. As far as I know, it is recommended to end the spark session after finishing the job in order the JVMs to close and free the resources.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a recommended way to stop/restart SparkSession in a databricks job?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 10:02:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-stop-sparksession-within-notebook-without-errr/m-p/36157#M26060</guid>
      <dc:creator>gkrilis</dc:creator>
      <dc:date>2023-06-29T10:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop SparkSession within notebook without errr</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-stop-sparksession-within-notebook-without-errr/m-p/47777#M28206</link>
      <description>&lt;P&gt;Please refer to this&amp;nbsp;&lt;A href="https://kb.databricks.com/en_US/jobs/job-fails-spark-finishes?_gl=1*1gh9veh*_gcl_au*MTYwNjYxNTA1MS4xNjk2MjE0Mzk5*_ga*MTIxMzMyNzkyMy4xNjk2MjE0NDA4*_ga_PQSEQ3RZQC*MTY5NjI5OTIxNC4yLjEuMTY5NjI5OTQ3NS42MC4wLjA.*rs_ga*ODM2MjQyODgtZDI5Mi00ZTJhLTliMjgtMTc0OGQyYjZlYWQw*rs_ga_PQSEQ3RZQC*MTY5NjI5OTIxNS4zLjEuMTY5NjI5OTQ3Ny4yMi4wLjA." target="_blank"&gt;Job fails, but Apache Spark tasks finish - Databricks&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 02:25:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-stop-sparksession-within-notebook-without-errr/m-p/47777#M28206</guid>
      <dc:creator>PremadasV</dc:creator>
      <dc:date>2023-10-03T02:25:37Z</dc:date>
    </item>
  </channel>
</rss>

