Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class ClientE2ETestSuite extends RemoteSparkSession with SQLHelper with PrivateM
|""".stripMargin)
.collect()
}
assert(ex.getErrorClass != null)
if (enrichErrorEnabled) {
assert(ex.getCause.isInstanceOf[DateTimeException])
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private[client] object GrpcExceptionConverter {
private[client] case class ErrorParams(
message: String,
cause: Option[Throwable],
// errorClass will only be set if the error is both enriched and SparkThrowable.
// errorClass will only be set if the error is SparkThrowable.
errorClass: Option[String],
// messageParameters will only be set if the error is both enriched and SparkThrowable.
messageParameters: Map[String, String],
Expand Down Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the PR #44468

Copy link
Contributor Author

@heyihong heyihong Dec 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for letting me know! I left some comments in #44468 (comment)

.build())
}

errorsToThrowable(0, Seq(builder.build()))
}
}