You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2023/01/13 20:01:00 UTC

[GitHub] [spark] rangadi commented on a diff in pull request #39536: [SPARK-42057][SQL][PROTOBUF] Fix how exception is handled in error reporting.

rangadi commented on code in PR #39536:
URL: https://github.com/apache/spark/pull/39536#discussion_r1069966877


##########
connector/protobuf/src/test/scala/org/apache/spark/sql/protobuf/ProtobufFunctionsSuite.scala:
##########
@@ -1248,6 +1248,23 @@ class ProtobufFunctionsSuite extends QueryTest with SharedSparkSession with Prot
     testFromProtobufWithOptions(df, expectedDfTwo, optionsTwo)
   }
 
+  test("Verify exceptions are correctly propagated with errors") {
+    // This triggers an query compilation error and ensures that original exception is
+    // also included in in the exception.
+
+    val invalidDescPath = "/non/existent/path.desc"
+
+    val ex = intercept[AnalysisException] {

Review Comment:
   Added `checkError()`. Note that it does not replace the asserts since those assert check for 'getCause'. 



-- 
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-unsubscribe@spark.apache.org

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


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