[ 
https://issues.apache.org/jira/browse/SPARK-46581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wenchen Fan resolved SPARK-46581.
---------------------------------
    Fix Version/s: 4.0.0
       Resolution: Fixed

Issue resolved by pull request 44583
[https://github.com/apache/spark/pull/44583]

> AccumulatorV2 isZero doesn't do what its name implies
> -----------------------------------------------------
>
>                 Key: SPARK-46581
>                 URL: https://issues.apache.org/jira/browse/SPARK-46581
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 3.5.0
>            Reporter: Davin Tjong
>            Assignee: Davin Tjong
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>
> `AccumulatorV2`'s `isZero` doesn't do what the name or comment implies - it 
> actually checks if the accumulator hasn't been updated.
> The comment implies that for a `LongAccumulator`, for example, a value of `0` 
> would cause `isZero` to be `true`. But if we were to `add(0)`, then the value 
> would still be `0` but `isZero` would return `false`.
> Propose to rename this to `isUpdated` so the name matches the meaning more 
> closely.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to