heyihong commented on code in PR #42859:
URL: https://github.com/apache/spark/pull/42859#discussion_r1320405138
##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/streaming/StreamingQuery.scala:
##########
@@ -242,17 +242,15 @@ class RemoteStreamingQuery(
}
override def exception: Option[StreamingQueryException] = {
- val exception = executeQueryCmd(_.setException(true)).getException
- if (exception.hasExceptionMessage) {
- Some(
- new StreamingQueryException(
- // message maps to the return value of original
StreamingQueryException's toString method
- message = exception.getExceptionMessage,
- errorClass = exception.getErrorClass,
- stackTrace = exception.getStackTrace))
- } else {
- None
+ try {
+ // When setException is false, the server throws a
StreamingQueryException
+ // to the client.
+ executeQueryCmd(_.setException(false))
+ } catch {
+ case e: StreamingQueryException => return Some(e)
Review Comment:
With https://github.com/apache/spark/pull/42377, error translation (via
throw) not only reconstructs StreamingQueryException but also its cause
exceptions with full messages (via a additional RPC) so throwing exception
seems to be preferrable.
The FetchErrorDetail RPC is similar to how StreamingQueryException is
currently reconstructed on the client side but it is done in a more general way
--
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]