This is an automated email from the ASF dual-hosted git repository.
maxgekk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 071c684dee44 [MINOR][SQL] Convert `UnresolvedException` to an internal
error
071c684dee44 is described below
commit 071c684dee44665691ddab916021d4920a9ac51b
Author: Max Gekk <[email protected]>
AuthorDate: Tue Dec 12 18:06:48 2023 +0300
[MINOR][SQL] Convert `UnresolvedException` to an internal error
### What changes were proposed in this pull request?
In the PR, I propose to change the parent class of `UnresolvedException`
from `AnalysisException` to `SparkException` with the error class
`INTERNAL_ERROR`. If an user observes the error, this is definitely a bug in
the compiler.
### Why are the changes needed?
To unify all Spark exceptions, and assign an error class. So, this should
improve user experience with Spark SQL.
### Does this PR introduce _any_ user-facing change?
No, users shouldn't face to the error in regular cases.
### How was this patch tested?
By existing GAs.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #44311 from MaxGekk/error-class-UnresolvedException.
Authored-by: Max Gekk <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
---
.../scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
index 97912fb5d592..e1dec5955a7f 100644
---
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
+++
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
@@ -37,7 +37,10 @@ import org.apache.spark.util.ArrayImplicits._
* resolved.
*/
class UnresolvedException(function: String)
- extends AnalysisException(s"Invalid call to $function on unresolved object")
+ extends SparkException(
+ errorClass = "INTERNAL_ERROR",
+ messageParameters = Map("message" -> s"Invalid call to $function on
unresolved object"),
+ cause = null)
/** Parent trait for unresolved node types */
trait UnresolvedNode extends LogicalPlan {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]