HyukjinKwon commented on code in PR #37177:
URL: https://github.com/apache/spark/pull/37177#discussion_r920599996


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala:
##########
@@ -71,7 +71,16 @@ object JdbcUtils extends Logging with SQLConfHelper {
       } finally {
         statement.close()
       }
-    }.isSuccess
+    } match {
+      case Success(_) => true
+      // This may be a known `TableAlreadyExist` exception, which is normal 
and proves that the
+      // table does not exist, but perhaps some other exception, which in fact 
does exist, will
+      // cause an error when renewing the table later. We need to know about 
the exception stack
+      case Failure(e) =>
+        logDebug(s"Jdbc detect the table whether exists, exception is (It may 
be a known and" +

Review Comment:
   ```suggestion
           logDebug("JDBC detect the table whether exists, exception is (It may 
be a known and" +
   ```



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala:
##########
@@ -71,7 +71,16 @@ object JdbcUtils extends Logging with SQLConfHelper {
       } finally {
         statement.close()
       }
-    }.isSuccess
+    } match {
+      case Success(_) => true
+      // This may be a known `TableAlreadyExist` exception, which is normal 
and proves that the
+      // table does not exist, but perhaps some other exception, which in fact 
does exist, will
+      // cause an error when renewing the table later. We need to know about 
the exception stack
+      case Failure(e) =>
+        logDebug(s"Jdbc detect the table whether exists, exception is (It may 
be a known and" +

Review Comment:
   ```suggestion
           logDebug("JDBC detect the table whether exists, exception is (it may 
be a known and" +
   ```



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