You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Max Gekk (Jira)" <ji...@apache.org> on 2022/02/09 15:40:00 UTC

[jira] [Updated] (SPARK-38163) Preserve the error class of `AnalysisException` while constructing of function builder

     [ https://issues.apache.org/jira/browse/SPARK-38163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Max Gekk updated SPARK-38163:
-----------------------------
    Description: 
When the cause exception is `AnalysisException` at
https://github.com/apache/spark/blob/9c02dd4035c9412ca03e5a5f4721ee223953c004/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala#L132, Spark loses info about the error class. Need to preserve the info.

The example below demonstrates the issue:

{code:scala}
scala> try { sql("select format_string('%0$s', 'Hello')") } catch { case e: org.apache.spark.sql.AnalysisException => println(e.getErrorClass) }
null
{code}


  was:
When the cause exception is `AnalysisException` at
https://github.com/apache/spark/blob/9c02dd4035c9412ca03e5a5f4721ee223953c004/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala#L132, Spark loses info about the error class. Need to preserve the info.


> Preserve the error class of `AnalysisException` while constructing of function builder
> --------------------------------------------------------------------------------------
>
>                 Key: SPARK-38163
>                 URL: https://issues.apache.org/jira/browse/SPARK-38163
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.3.0
>            Reporter: Max Gekk
>            Assignee: Max Gekk
>            Priority: Major
>
> When the cause exception is `AnalysisException` at
> https://github.com/apache/spark/blob/9c02dd4035c9412ca03e5a5f4721ee223953c004/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala#L132, Spark loses info about the error class. Need to preserve the info.
> The example below demonstrates the issue:
> {code:scala}
> scala> try { sql("select format_string('%0$s', 'Hello')") } catch { case e: org.apache.spark.sql.AnalysisException => println(e.getErrorClass) }
> null
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org