You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/09/12 21:58:44 UTC

[GitHub] [spark] gengliangwang commented on a diff in pull request #37834: [SPARK-40400][SQL] Pass error message parameters to exceptions as maps

gengliangwang commented on code in PR #37834:
URL: https://github.com/apache/spark/pull/37834#discussion_r968968699


##########
core/src/main/scala/org/apache/spark/SparkException.scala:
##########
@@ -128,13 +140,16 @@ private[spark] case class ExecutorDeadException(message: String)
 private[spark] class SparkUpgradeException(
     errorClass: String,
     errorSubClass: Option[String] = None,
-    messageParameters: Array[String],
+    messageParameters: Map[String, String],
     cause: Throwable)
-  extends RuntimeException(SparkThrowableHelper.getMessage(errorClass, errorSubClass.orNull,
-    messageParameters), cause)
-    with SparkThrowable {
+  extends RuntimeException(
+    SparkThrowableHelper.getMessage(errorClass, errorSubClass.orNull, messageParameters), cause)
+  with SparkThrowable {
+
+  override def getMessageParameters: Array[String] = {
+    SparkThrowableHelper.getMessageParameters(errorClass, errorSubClass.orNull, messageParameters)

Review Comment:
   @MaxGekk @srielau This line shows up many times in this PR.
   Do we consider further refactoring the parameters in `SparkThrowable`? E.g. combine `String[] getMessageParameters` and `String[] getParameterNames` into `Map<String, String> getMessageParameters`
   
   



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