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


##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/H2Dialect.scala:
##########
@@ -56,13 +56,13 @@ private[sql] case class H2Dialect() extends JdbcDialect 
with NoLegacyJDBCError {
   override def isSupportedFunction(funcName: String): Boolean =
     supportedFunctions.contains(funcName)
 
-  override def isObjectNotFoundException(e: SQLException): Boolean = {
-    Set(42102, 42103, 42104, 90079).contains(e.getErrorCode)
+  override def isObjectNotFoundException(e: SQLException): Option[Boolean] = {
+    Some(Set(42102, 42103, 42104, 90079).contains(e.getErrorCode))
   }
 
   // See https://www.h2database.com/javadoc/org/h2/api/ErrorCode.html
-  override def isSyntaxErrorBestEffort(exception: SQLException): Boolean = {
-    Option(exception.getSQLState).exists(_.startsWith("42"))
+  override def isSyntaxErrorBestEffort(exception: SQLException): 
Option[Boolean] = {
+    Some(Option(exception.getSQLState).exists(_.startsWith("42")))

Review Comment:
   We can simplify this expression
   ```suggestion
       Option(exception.getSQLState).map(_.startsWith("42"))
   ```



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