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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -3344,7 +3344,7 @@ private[sql] object QueryCompilationErrors extends 
QueryErrorsBase {
   def failedParsingDescriptorError(descFilePath: String, cause: Throwable): 
Throwable = {
     new AnalysisException(
       errorClass = "CANNOT_CONSTRUCT_PROTOBUF_DESCRIPTOR",

Review Comment:
   Could you add a test for this error class.



##########
connector/protobuf/src/test/scala/org/apache/spark/sql/protobuf/ProtobufSerdeSuite.scala:
##########
@@ -177,6 +177,19 @@ 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",

Review Comment:
   @SandishKumarHN Thank you for the added test.



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