You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "aokolnychyi (via GitHub)" <gi...@apache.org> on 2023/04/24 20:20:42 UTC

[GitHub] [spark] aokolnychyi commented on a diff in pull request #40934: [SPARK-43268][SQL] Use proper error classes when exceptions are constructed with a message

aokolnychyi commented on code in PR #40934:
URL: https://github.com/apache/spark/pull/40934#discussion_r1175744775


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/AlreadyExistException.scala:
##########
@@ -56,7 +56,10 @@ class NamespaceAlreadyExistsException private(
   }
 
   def this(message: String) = {
-    this(message, errorClass = None, messageParameters = Map.empty[String, String])
+    this(
+      message,
+      errorClass = Some("SCHEMA_ALREADY_EXISTS"),

Review Comment:
   It is a bit unfortunate we have to use the same string literal in multiple places. Adding a constant would require a companion object and an import as these values are accessed in constructors. I was not sure it would be worth it so kept as is.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org