You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Milan Dankovic (Jira)" <ji...@apache.org> on 2025/06/16 12:42:00 UTC
[jira] [Updated] (SPARK-52489) [M2] Forbid duplicate SQLEXCEPTION and NOT FOUND handlers inside SQL Script
[ https://issues.apache.org/jira/browse/SPARK-52489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Milan Dankovic updated SPARK-52489:
-----------------------------------
Description:
This code should not work, but it works. Current behavior is that the last handler being recognized as the correct one. We should throw an error when duplicate handlers are defined in the same scope.
{code:java}
BEGIN
DECLARE EXIT HANDLER FOR NOT FOUND
BEGIN
SELECT 1;
END;
DECLARE EXIT HANDLER FOR NOT FOUND
BEGIN
SELECT 2;
END;
END{code}
was:
This code should not work, but it works. Current behavior is that the last handler being recognized as the correct one. We should throw an error when duplicate handlers are defined in the same scope.
```
{{{}BEGIN{}}}{{{}DECLARE EXIT HANDLER FOR NOT FOUND
BEGIN
SELECT 1;
END;
DECLARE EXIT HANDLER FOR NOT FOUND
BEGIN
SELECT 2;
END;
END{}}}
```
> [M2] Forbid duplicate SQLEXCEPTION and NOT FOUND handlers inside SQL Script
> ---------------------------------------------------------------------------
>
> Key: SPARK-52489
> URL: https://issues.apache.org/jira/browse/SPARK-52489
> Project: Spark
> Issue Type: Sub-task
> Components: Spark Core
> Affects Versions: 4.0.0
> Reporter: Milan Dankovic
> Priority: Major
>
> This code should not work, but it works. Current behavior is that the last handler being recognized as the correct one. We should throw an error when duplicate handlers are defined in the same scope.
> {code:java}
> BEGIN
> DECLARE EXIT HANDLER FOR NOT FOUND
> BEGIN
> SELECT 1;
> END;
> DECLARE EXIT HANDLER FOR NOT FOUND
> BEGIN
> SELECT 2;
> END;
> END{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org