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


##########
connector/protobuf/src/test/scala/org/apache/spark/sql/protobuf/ProtobufSerdeSuite.scala:
##########
@@ -163,18 +163,22 @@ class ProtobufSerdeSuite extends SharedSparkSession {
       fieldMatchType: MatchType,
       expectedCauseMessage: String,
       catalystSchema: StructType = CATALYST_STRUCT): Unit = {
-    val e = intercept[IncompatibleSchemaException] {
+    val e = intercept[Exception] {
       serdeFactory.create(catalystSchema, protoSchema, fieldMatchType)
     }
     val expectMsg = serdeFactory match {
       case Deserializer =>
-        s"Cannot convert Protobuf type ${protoSchema.getName} to SQL type 
${catalystSchema.sql}."
+        s"[PROTOBUF_TYPE_TO_CATALYST_TYPE_ERROR] Unable to convert" +
+          s" ${protoSchema.getName} of Protobuf to SQL type 
${toSQLType(catalystSchema)}."
       case Serializer =>
-        s"Cannot convert SQL type ${catalystSchema.sql} to Protobuf type 
${protoSchema.getName}."
+        s"[UNABLE_TO_CONVERT_TO_PROTOBUF_TYPE] Unable to convert SQL type" +
+          s" ${toSQLType(catalystSchema)} to Protobuf type 
${protoSchema.getName}."
     }
 
     assert(e.getMessage === expectMsg)
-    assert(e.getCause.getMessage === expectedCauseMessage)
+    if (e.getCause != null) {
+      assert(e.getCause.getMessage === expectedCauseMessage)

Review Comment:
   made changes to support new error class frameworks. 



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