alekjarmov commented on code in PR #58862:
URL: https://github.com/apache/spark/pull/58862#discussion_r4039109941


##########
connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/SharedJDBCIntegrationSuite.scala:
##########
@@ -63,14 +63,25 @@ abstract class SharedJDBCIntegrationSuite extends 
DockerJDBCIntegrationSuite {
 
     // Exception should be detected in analysis phase first when we resolve a 
schema from
     // through JDBC by sending SELECT * FROM (<subquery>) [LIMIT 1][WHERE 1=0] 
query.
-    checkErrorMatchPVals(
-      ex,
+    checkError(
+      exception = ex,
       condition = 
"JDBC_EXTERNAL_ENGINE_SYNTAX_ERROR.DURING_OUTPUT_SCHEMA_RESOLUTION",
+      sqlState = Some("42000"),
       parameters = Map(
         "jdbcQuery" -> "SELECT \\* FROM \\(.*",
-        "externalEngineError" -> "[\\s\\S]*"
-      )
+        "externalEngineError" -> "[\\s\\S]+",
+        "externalEngineSqlState" -> ".+"
+      ),
+      matchPVals = true
     )
+    ex.getCause match {
+      case cause: SQLException =>
+        val expectedSqlState =
+          Option(cause.getSQLState).filter(_.nonEmpty).getOrElse("unknown")
+        assert(ex.getMessageParameters.get("externalEngineSqlState") === 
expectedSqlState)

Review Comment:
   done



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