panbingkun commented on code in PR #46969:
URL: https://github.com/apache/spark/pull/46969#discussion_r1637892881


##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/MsSqlServerDialect.scala:
##########
@@ -210,12 +210,16 @@ private case class MsSqlServerDialect() extends 
JdbcDialect {
       description: String): AnalysisException = {
     e match {
       case sqlException: SQLException =>
+        logSQLException(sqlException, errorClass, messageParameters, 
description)
         sqlException.getErrorCode match {
           case 3729 =>
             throw NonEmptyNamespaceException(
               namespace = messageParameters.get("namespace").toArray,
               details = sqlException.getMessage,
               cause = Some(e))
+           case 15335 if errorClass == "FAILED_JDBC.RENAME_TABLE" =>

Review Comment:
   ref:
   ```
   errorCode: 15335, sqlState: S0001, message: Error: The new name 'tbl1' is 
already in use as a object name and would cause a duplicate that is not 
permitted., errorClass: FAILED_JDBC.RENAME_TABLE, messageParameters: Map(url -> 
jdbc:sqlserver://10.1.0.20:38701;user=sa;***;encrypt=true;trustServerCertificate=true,
 oldName -> `tbl2`, newName -> `tbl1`),description: Failed table renaming from 
tbl2 to tbl1
   ```



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