spark.sql query is executing from the except block even though the try block is succeeded
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 05:54 PM
I have developed a azure databricks notebook where data will be copied from landing zone to STG delta table, used Try and except blocks in the code to catch the errors, if their is an error the except block will catch the error message. In the except block i have written the sql query to update the values in audit table by using spark.sql. My issue is when try block got succeeded some how the sql query in except block is executing and updating the audit table for the error description column with the output of the succeeded Try block . Please suggest me in this regard.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 06:29 PM

