Skip to content

Commit 5a53086

Browse files
Yicong-HuangHyukjinKwon
authored andcommitted
[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

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

python/pyspark/worker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3474,7 +3474,6 @@ def main(infile, outfile):
34743474

34753475
shuffle.MemoryBytesSpilled = 0
34763476
shuffle.DiskBytesSpilled = 0
3477-
_accumulatorRegistry.clear()
34783477

34793478
setup_spark_files(infile)
34803479
setup_broadcasts(infile)

0 commit comments

Comments
 (0)