Commit 5a53086
[SPARK-54930][PYTHON] Remove redundant _accumulatorRegistry.clear() call in worker.py
### What changes were proposed in this pull request?
Remove a redundant `_accumulatorRegistry.clear()` call in `worker.py`.
Currently there are two consecutive `clear()` calls with no accumulator-modifying code in between:
```python
shuffle.MemoryBytesSpilled = 0
shuffle.DiskBytesSpilled = 0
_accumulatorRegistry.clear() # first call
setup_spark_files(infile)
setup_broadcasts(infile)
_accumulatorRegistry.clear() # second call
```
Neither `setup_spark_files` nor `setup_broadcasts` adds anything to `_accumulatorRegistry`, so the first `clear()` is redundant.
### Why are the changes needed?
This is dead code cleanup. The redundant call was introduced when:
- SPARK-3463 (2014) added the first `clear()` after shuffle initialization
- SPARK-3030 (2014) added the second `clear()` after broadcasts setup
- SPARK-44533 (2023) refactored to extract `setup_spark_files` and `setup_broadcasts`, but preserved both `clear()` calls
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing tests. This is a simple dead code removal with no functional change.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #53708 from Yicong-Huang/SPARK-54930/refactor/remove-redundant-clear.
Authored-by: Yicong-Huang <17627829+Yicong-Huang@users.noreply.github.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>1 parent 186570c commit 5a53086
1 file changed
+0
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3474 | 3474 | | |
3475 | 3475 | | |
3476 | 3476 | | |
3477 | | - | |
3478 | 3477 | | |
3479 | 3478 | | |
3480 | 3479 | | |
| |||
0 commit comments