jingz-db commented on code in PR #47819:
URL: https://github.com/apache/spark/pull/47819#discussion_r1731642856


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/sources/ForeachWriterSuite.scala:
##########
@@ -142,8 +142,12 @@ class ForeachWriterSuite extends StreamTest with 
SharedSparkSession with BeforeA
       val e = intercept[StreamingQueryException] {
         query.processAllAvailable()
       }
-      assert(e.getCause.isInstanceOf[SparkException])
-      assert(e.getCause.getCause.getMessage === "ForeachSinkSuite error")
+
+      val errClass = "FOREACH_USER_FUNCTION_ERROR"
+
+      // verify that we classified the exception
+      assert(e.getMessage.contains(errClass))

Review Comment:
   Thanks for your review! I am afraid we cannot use checkError here as the 
errorClass that e returns is `STREAM_FAILED` and the 
`FOREACH_USER_FUNCTION_ERROR` was thrown as part of the message instead of 
cause 
[here](https://github.com/apache/spark/pull/45449/files#diff-7e8a99d76adb60a2d85609ab46bb2867cd83de106b3c048d6d955805824c9bb6R335)
 .



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to