Github user zsxwing commented on a diff in the pull request:
https://github.com/apache/spark/pull/16125#discussion_r90767030
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/streaming/StreamingQueryException.scala
---
@@ -24,32 +24,42 @@ import
org.apache.spark.sql.execution.streaming.{Offset, OffsetSeq, StreamExecut
* :: Experimental ::
* Exception that stopped a [[StreamingQuery]]. Use `cause` get the actual
exception
* that caused the failure.
- * @param query Query that caused the exception
* @param message Message of this exception
* @param cause Internal cause of this exception
- * @param startOffset Starting offset (if known) of the range of data in
which exception occurred
- * @param endOffset Ending offset (if known) of the range of data in
exception occurred
+ * @param startOffset Starting offset in json of the range of data in
which exception occurred
+ * @param endOffset Ending offset in json of the range of data in
exception occurred
* @since 2.0.0
*/
@Experimental
-class StreamingQueryException private[sql](
- @transient val query: StreamingQuery,
+class StreamingQueryException private(
+ causeString: String,
val message: String,
val cause: Throwable,
- val startOffset: Option[OffsetSeq] = None,
- val endOffset: Option[OffsetSeq] = None)
+ val startOffset: String,
+ val endOffset: String)
extends Exception(message, cause) {
+ private[sql] def this(
+ query: StreamingQuery,
+ message: String,
+ cause: Throwable,
+ startOffset: String,
+ endOffset: String) {
+ this(
+ // scalastyle:off
+ s"""${classOf[StreamingQueryException].getName}: ${cause.getMessage}
${cause.getStackTrace.take(10).mkString("", "\n|\t", "\n")}
--- End diff --
The class name here allows
[capture_sql_exception](https://github.com/apache/spark/blob/4a3c09601ba69f7d49d1946bb6f20f5cfe453031/python/pyspark/sql/utils.py#L60)
to convert Java StreamingQueryException to Python StreamingQueryException.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]