[WIP][SPARK-48353][SQL] Introduction of Error Handling mechanism in SQL Scripting
What changes were proposed in this pull request?
This pull request introduces the logic of error handling inside SQL Scripting language. Now, it is possible to:
- declare conditions for specific SQL States
- declare handlers to catch and process errors that are risen during statement execution
Why are the changes needed?
The intent is to add the possibility for user to handle SQL errors in a custom defined way..
Does this PR introduce any user-facing change?
No.
How was this patch tested?
There are already existing test suites for SQL scripting that have been improved to test new functionalities:
SqlScriptingParserSuiteSqlScriptingExecutionNodeSuiteSqlScriptingInterpreterSuite
Was this patch authored or co-authored using generative AI tooling?
No.
Additional changes:
Added cleanup method inside CompoundBody to handle premature exit. Currently this can happen while executing leave statement.
NEED TO FIX (follow-up work):
- No checks for recursion (direct or indirect) we will probably skip this for now.
- If the handler itself raises a condition, it cannot handle that condition, nor can any other handlers declared in the block.
Waiting on this PR to merge first
@miland-db please add a more detailed PR description, there is a lot of details and it would probably help folks when reviewing.
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!