You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2024/01/05 03:36:30 UTC

Re: [PR] [SPARK-46581][CORE] Update comment on isZero in AccumulatorV2 [spark]

cloud-fan commented on code in PR #44583:
URL: https://github.com/apache/spark/pull/44583#discussion_r1442467033


##########
core/src/main/scala/org/apache/spark/util/AccumulatorV2.scala:
##########
@@ -114,8 +114,8 @@ abstract class AccumulatorV2[IN, OUT] extends Serializable {
   final private[spark] def isAtDriverSide: Boolean = atDriverSide
 
   /**
-   * Returns if this accumulator is zero value or not. e.g. for a counter accumulator, 0 is zero
-   * value; for a list accumulator, Nil is zero value.
+   * Returns false if this accumulator has been updated. Note that this can be true even when
+   * the value is a zero value, if the accumulator was updated with a zero value.

Review Comment:
   I think the previous comment is fine. Each accumulator can define the semantic of zero value by its own.



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