urosstan-db commented on code in PR #58621:
URL: https://github.com/apache/spark/pull/58621#discussion_r3972815463


##########
sql/core/src/test/scala/org/apache/spark/sql/jdbc/PostgresDialectSuite.scala:
##########
@@ -82,6 +82,14 @@ class PostgresDialectSuite extends SparkFunSuite with 
MockitoSugar {
     verify(conn).setAutoCommit(false)
   }
 
+  test("SPARK-59336: classify only syntax error SQLSTATEs as syntax errors") {
+    assert(dialect.isSyntaxErrorBestEffort(new SQLException("syntax error", 
"42000")))
+    assert(dialect.isSyntaxErrorBestEffort(new SQLException("syntax error", 
"42601")))
+    assert(!dialect.isSyntaxErrorBestEffort(new SQLException("permission 
denied", "42501")))
+    assert(!dialect.isSyntaxErrorBestEffort(new SQLException("undefined 
table", "42P01")))
+    assert(!dialect.isSyntaxErrorBestEffort(new SQLException("error without 
SQLSTATE")))
+  }

Review Comment:
   I would not go that deep with unit testing for one-liner method



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