MaxGekk commented on code in PR #36350:
URL: https://github.com/apache/spark/pull/36350#discussion_r861271695


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala:
##########
@@ -587,8 +587,13 @@ object QueryExecutionErrors extends QueryErrorsBase {
        """.stripMargin)
   }
 
-  def unsupportedSaveModeError(saveMode: String, pathExists: Boolean): 
Throwable = {
-    new IllegalStateException(s"unsupported save mode $saveMode ($pathExists)")
+  def saveModeUnsupportedError(saveMode: Any, pathExists: Boolean): Throwable 
= {
+    pathExists match {
+      case true => new SparkIllegalStateException(errorClass = 
"UNSUPPORTED_SAVE_MODE",

Review Comment:
   I think it is better to use `SparkIllegalArgumentException` here.



##########
core/src/main/scala/org/apache/spark/ErrorInfo.scala:
##########
@@ -80,9 +80,9 @@ private[spark] object SparkThrowableHelper {
       val errorSubInfo = subClass.getOrElse(subErrorClass,
         throw new IllegalArgumentException(s"Cannot find sub error class 
'$subErrorClass'"))
       val subMessageParameters = messageParameters.tail
-      "[" + errorClass + "." + subErrorClass + "] " + errorInfo.messageFormat +
-        
String.format(errorSubInfo.messageFormat.replaceAll("<[a-zA-Z0-9_-]+>", "%s"),
-          subMessageParameters: _*)
+      "[" + errorClass + "." + subErrorClass + "] " + 
String.format((errorInfo.messageFormat +
+        errorSubInfo.messageFormat).replaceAll("<[a-zA-Z0-9_-]+>", "%s"),
+        subMessageParameters: _*)

Review Comment:
   Could you explain why do you need to modify this, please.



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