allisonwang-db commented on code in PR #40966:
URL: https://github.com/apache/spark/pull/40966#discussion_r1178591206
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -2326,10 +2328,21 @@ class SparkConnectPlanner(val session: SparkSession) {
case StreamingQueryCommand.CommandCase.EXCEPTION =>
val result = query.exception
- result.foreach(e =>
- respBuilder.getExceptionBuilder
+ if (result.isDefined) {
+ val e = result.get
+ val exception_builder = StreamingQueryCommandResult.ExceptionResult
+ .newBuilder()
+ exception_builder
.setExceptionMessage(SparkConnectService.abbreviateErrorMessage(e.toString))
- .setErrorClass(e.getErrorClass))
+ .setErrorClass(e.getErrorClass)
+
+ val maxSize = SparkEnv.get.conf.get(CONNECT_JVM_STACK_TRACE_MAX_SIZE)
+ val stackTrace = Option(ExceptionUtils.getStackTrace(e))
+ stackTrace.foreach { s =>
+ exception_builder.setStackTrace(StringUtils.abbreviate(s, maxSize))
Review Comment:
The error message and stack trace are truncated due to the HTTP header size
limitation (default 8k). I noticed that you're not throwing this as a
StatusRuntimeException. If the same limitation doesn't apply here, you could
use untruncated messages and stack traces.
--
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]