heyihong commented on code in PR #42377:
URL: https://github.com/apache/spark/pull/42377#discussion_r1310939456


##########
connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/GrpcExceptionConverter.scala:
##########
@@ -64,6 +69,94 @@ private[client] object GrpcExceptionConverter extends 
JsonUtils {
     }
   }
 
+  private def enrichError(errors: Array[Error], info: ErrorInfo): Array[Error] 
= {
+    val sessionId = info.getMetadataOrDefault("sessionId", null)
+    val userId = info.getMetadataOrDefault("userId", null)

Review Comment:
   The idea is to make the ErrorInfo self-contained for issuing the follow up 
FetchErrorDetails request. Otherwise, it may make the implementation on the 
client side a bit more complicate since each FetchErrorDetails call needs to 
figure out the corresponding session id and user id



##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectService.scala:
##########
@@ -201,6 +201,20 @@ class SparkConnectService(debug: Boolean) extends 
AsyncService with BindableServ
         sessionId = request.getSessionId)
   }
 
+  override def getErrorInfo(
+      request: proto.GetErrorInfoRequest,
+      responseObserver: StreamObserver[proto.GetErrorInfoResponse]): Unit = {
+    try {
+      new SparkConnectGetErrorInfoHandler(responseObserver).handle(request)
+    } catch {
+      ErrorUtils.handleError(
+        "getErrorInfo",
+        observer = responseObserver,
+        userId = request.getUserContext.getUserId,
+        sessionId = request.getSessionId)

Review Comment:
   https://github.com/apache/spark/pull/42377#discussion_r1310939456



-- 
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]

Reply via email to