<?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 Spark read CSV does not throw Exception if the file path is not available in Databricks 14.3 in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/spark-read-csv-does-not-throw-exception-if-the-file-path-is-not/m-p/66687#M7752</link>
    <description>&lt;P&gt;We were using this method and this was working as expected in Databricks 13.3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;def read_file():
  try:
    df_temp_dlr_kpi = spark.read.load(raw_path,format="csv", schema=kpi_schema)
    return df_temp_dlr_kpi                          
  except Exception as e:
    error_message = str(e)
    print(error_message)
    dbutils.notebook.exit('Fail')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now we have upgraded databricks to 14.3 and now method get returned without catching the exception when the file is not available.&lt;/P&gt;&lt;P&gt;When we call the method, unhandled exception generates as shown below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-19 at 13.29.19.png" style="width: 635px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/7141iE1159A5A8E83E3FC/image-dimensions/635x320/is-moderation-mode/true?v=v2" width="635" height="320" role="button" title="Screenshot 2024-04-19 at 13.29.19.png" alt="Screenshot 2024-04-19 at 13.29.19.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain why we are experiencing this behaviour, and the solution to catch the exception?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Fri, 19 Apr 2024 08:06:24 GMT</pubDate>
    <dc:creator>thilanka02</dc:creator>
    <dc:date>2024-04-19T08:06:24Z</dc:date>
    <item>
      <title>Spark read CSV does not throw Exception if the file path is not available in Databricks 14.3</title>
      <link>https://community.databricks.com/t5/get-started-discussions/spark-read-csv-does-not-throw-exception-if-the-file-path-is-not/m-p/66687#M7752</link>
      <description>&lt;P&gt;We were using this method and this was working as expected in Databricks 13.3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;def read_file():
  try:
    df_temp_dlr_kpi = spark.read.load(raw_path,format="csv", schema=kpi_schema)
    return df_temp_dlr_kpi                          
  except Exception as e:
    error_message = str(e)
    print(error_message)
    dbutils.notebook.exit('Fail')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But now we have upgraded databricks to 14.3 and now method get returned without catching the exception when the file is not available.&lt;/P&gt;&lt;P&gt;When we call the method, unhandled exception generates as shown below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-04-19 at 13.29.19.png" style="width: 635px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/7141iE1159A5A8E83E3FC/image-dimensions/635x320/is-moderation-mode/true?v=v2" width="635" height="320" role="button" title="Screenshot 2024-04-19 at 13.29.19.png" alt="Screenshot 2024-04-19 at 13.29.19.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain why we are experiencing this behaviour, and the solution to catch the exception?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 08:06:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/spark-read-csv-does-not-throw-exception-if-the-file-path-is-not/m-p/66687#M7752</guid>
      <dc:creator>thilanka02</dc:creator>
      <dc:date>2024-04-19T08:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Spark read CSV does not throw Exception if the file path is not available in Databricks 14.3</title>
      <link>https://community.databricks.com/t5/get-started-discussions/spark-read-csv-does-not-throw-exception-if-the-file-path-is-not/m-p/66697#M7753</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/103769"&gt;@thilanka02&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;It looks like there is a bug in Spark 3.5, nothing much you can do about it rn.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://issues.apache.org/jira/browse/SPARK-47708" target="_blank"&gt;https://issues.apache.org/jira/browse/SPARK-47708&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 09:13:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/spark-read-csv-does-not-throw-exception-if-the-file-path-is-not/m-p/66697#M7753</guid>
      <dc:creator>daniel_sahal</dc:creator>
      <dc:date>2024-04-19T09:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: Spark read CSV does not throw Exception if the file path is not available in Databricks 14.3</title>
      <link>https://community.databricks.com/t5/get-started-discussions/spark-read-csv-does-not-throw-exception-if-the-file-path-is-not/m-p/66715#M7754</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/79106"&gt;@daniel_sahal&lt;/a&gt;&amp;nbsp;for the reply&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 10:24:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/spark-read-csv-does-not-throw-exception-if-the-file-path-is-not/m-p/66715#M7754</guid>
      <dc:creator>thilanka02</dc:creator>
      <dc:date>2024-04-19T10:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: Spark read CSV does not throw Exception if the file path is not available in Databricks 14.3</title>
      <link>https://community.databricks.com/t5/get-started-discussions/spark-read-csv-does-not-throw-exception-if-the-file-path-is-not/m-p/79157#M7755</link>
      <description>&lt;P&gt;Hi, has this been resolved? I am still seeing this issue with Runtime 14.3 LTS&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 19:05:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/spark-read-csv-does-not-throw-exception-if-the-file-path-is-not/m-p/79157#M7755</guid>
      <dc:creator>databricks100</dc:creator>
      <dc:date>2024-07-17T19:05:57Z</dc:date>
    </item>
  </channel>
</rss>

