mridulm commented on code in PR #46904:
URL: https://github.com/apache/spark/pull/46904#discussion_r1633937558


##########
core/src/main/scala/org/apache/spark/util/AccumulatorV2.scala:
##########
@@ -165,8 +165,13 @@ abstract class AccumulatorV2[IN, OUT] extends Serializable 
{
   final protected def writeReplace(): Any = {
     if (atDriverSide) {
       if (!isRegistered) {
+        val printName = if (this.name.isDefined) {
+          s" '${this.name.get}' "
+        } else {
+          " "
+        }

Review Comment:
   ```suggestion
           val printName = this.name.getOrElse("")
   ```



##########
core/src/main/scala/org/apache/spark/util/AccumulatorV2.scala:
##########
@@ -165,8 +165,13 @@ abstract class AccumulatorV2[IN, OUT] extends Serializable 
{
   final protected def writeReplace(): Any = {
     if (atDriverSide) {
       if (!isRegistered) {
+        val printName = if (this.name.isDefined) {
+          s" '${this.name.get}' "
+        } else {
+          " "
+        }
         throw new UnsupportedOperationException(
-          "Accumulator must be registered before send to executor")
+          s"Accumulator${printName}must be registered before send to executor")
       }

Review Comment:
   My point was, this will end up being an empty string - since it is not 
registered.
   Did you try this in some case where it helped ?



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