davintjong-db opened a new pull request, #44583:
URL: https://github.com/apache/spark/pull/44583

   ### What changes were proposed in this pull request?
   
   Propose to rename this to `isUpdated` so the name matches the meaning more 
closely.
   
   
   ### Why are the changes needed?
   
   `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`.
   
   Thanks @arvindsaik for pointing this out.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   Existing tests.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No.


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