Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-46581][CORE] Update comment on isZero in AccumulatorV2
### What changes were proposed in this pull request? Two changes: - Update comment on `AccumulatorV2`'s `isZero` to reflect what it actually does. - Update variable name in `SQLMetrics` to `defaultValidValue` to reflect this ### Why are the changes needed? `AccumulatorV2`'s `isZero` doesn't do what the 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`. Changing the name of `zeroValue` to `defaultValidValue` to avoid confusion since `isZero` doesn't use `zeroValue` in `SQLMetric`. 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. Closes #44583 from davintjong-db/sqlmetric-zerovalue-refactor. Authored-by: Davin Tjong <davin.tjong@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
- Loading branch information