You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/02/09 16:26:43 UTC
[GitHub] [spark] MaxGekk opened a new pull request #35467: [SPARK-38163][SQL] Preserve the error class of `SparkThrowable` while constructing of function builder
MaxGekk opened a new pull request #35467:
URL: https://github.com/apache/spark/pull/35467
### What changes were proposed in this pull request?
In the PR, I propose to propagate `SparkThrowable` to user space AS IS in constructing of function builder. This allows to preserve the error class, for instance.
### Why are the changes needed?
This fixes the issues portrayed by the example below:
```scala
scala> try { sql("select format_string('%0$s', 'Hello')") } catch { case e: org.apache.spark.sql.AnalysisException => println(e.getErrorClass) }
null
```
The expected error should be `ILLEGAL_SUBSTRING`. It sets at https://github.com/apache/spark/blob/899d3bb44d7c72dc0179545189ac8170bde993a8/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala#L71.
### Does this PR introduce _any_ user-facing change?
Yes, the PR changes exceptions that can be handles by users.
After the changes:
```scala
scala> try { sql("select format_string('%0$s', 'Hello')") } catch { case e: org.apache.spark.sql.AnalysisException => println(e.getErrorClass) }
ILLEGAL_SUBSTRING
```
### How was this patch tested?
By running new test:
```
$ build/sbt "test:testOnly *QueryCompilationErrorsSuite"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon closed pull request #35467: [SPARK-38163][SQL] Preserve the error class of `SparkThrowable` while constructing of function builder
Posted by GitBox <gi...@apache.org>.
HyukjinKwon closed pull request #35467:
URL: https://github.com/apache/spark/pull/35467
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] HyukjinKwon commented on pull request #35467: [SPARK-38163][SQL] Preserve the error class of `SparkThrowable` while constructing of function builder
Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on pull request #35467:
URL: https://github.com/apache/spark/pull/35467#issuecomment-1034455774
Merged to master.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org