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


##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/PostgresDialect.scala:
##########
@@ -260,7 +260,10 @@ private case class PostgresDialect()
 
   // See https://www.postgresql.org/docs/current/errcodes-appendix.html
   override def isSyntaxErrorBestEffort(exception: SQLException): Boolean = {
-    Option(exception.getSQLState).exists(_.startsWith("42"))
+    exception.getSQLState match {
+      case "42000" | "42601" => true

Review Comment:
   Thanks a lot for comment, I was thinking whether we would need to exclude 
42000 and be more strict, or we want to be a little bit broader. And decided to 
go with a little bit broader catch, since most 42x common errors have subtype 
and it is hard to test every syntax issue in integration tests, while there is 
no big issue to classify some new uknown 42000 error as syntax error. We can 
iterate by the time, for now, I wanted to exclude 42x errors that are clearly 
false positives.



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