SandishKumarHN commented on code in PR #38515:
URL: https://github.com/apache/spark/pull/38515#discussion_r1015781498


##########
connector/protobuf/src/test/scala/org/apache/spark/sql/protobuf/ProtobufSerdeSuite.scala:
##########
@@ -177,6 +177,31 @@ class ProtobufSerdeSuite extends SharedSparkSession {
     withFieldMatchType(Deserializer.create(CATALYST_STRUCT, protoNestedFile, 
_))
   }
 
+  test("raise cannot parse protobuf descriptor error") {
+    // passing serde_suite.proto instead serde_suite.desc
+    val testFileDesc = testFile("serde_suite.proto").replace("file:/", "/")
+    val e = intercept[AnalysisException] {
+      ProtobufUtils.buildDescriptor(testFileDesc, "FieldMissingInSQLRoot")
+    }
+
+    checkError(
+      exception = e,
+      errorClass = "CANNOT_PARSE_PROTOBUF_DESCRIPTOR",
+      parameters = Map("descFilePath" -> testFileDesc))
+  }
+
+  test("raise cannot construct protobuf descriptor error") {
+    val testFileDesc = 
testFile("basicmessage_noimports.desc").replace("file:/", "/")
+    val e = intercept[AnalysisException] {
+      ProtobufUtils.parseFileDescriptorSet(testFileDesc)

Review Comment:
   @rangadi Check it out once again I've made a few minor changes.



-- 
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]

Reply via email to