MaxGekk commented on code in PR #43772:
URL: https://github.com/apache/spark/pull/43772#discussion_r1435575441
##########
connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/GrpcExceptionConverter.scala:
##########
@@ -367,14 +367,20 @@ private[client] object GrpcExceptionConverter {
implicit val formats = DefaultFormats
val classes =
JsonMethods.parse(info.getMetadataOrDefault("classes",
"[]")).extract[Array[String]]
-
- errorsToThrowable(
- 0,
- Seq(
- FetchErrorDetailsResponse.Error
+ val errorClass = info.getMetadataOrDefault("errorClass", null)
+ val builder = FetchErrorDetailsResponse.Error
+ .newBuilder()
+ .setMessage(message)
+ .addAllErrorTypeHierarchy(classes.toImmutableArraySeq.asJava)
+
+ if (errorClass != null) {
+ builder.setSparkThrowable(
+ FetchErrorDetailsResponse.SparkThrowable
.newBuilder()
- .setMessage(message)
- .addAllErrorTypeHierarchy(classes.toImmutableArraySeq.asJava)
- .build()))
+ .setErrorClass(errorClass)
Review Comment:
Just set an error class and don't set message parameters doesn't make any
sense. The `errorClass` is just a "type", it is impossible to create an object
`SparkThrowable` without parameters. The message above is a hole that we will
close soon.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]