Commit faf8dd5
[SPARK-33756][SQL] Make BytesToBytesMap's MapIterator idempotent
### What changes were proposed in this pull request?
Make MapIterator of BytesToBytesMap `hasNext` method idempotent
### Why are the changes needed?
The `hasNext` maybe called multiple times, if not guarded, second call of hasNext method after reaching the end of iterator will throw NoSuchElement exception.
### Does this PR introduce _any_ user-facing change?
NO.
### How was this patch tested?
Update a unit test to cover this case.
Closes #30728 from advancedxy/SPARK-33756.
Authored-by: Xianjin YE <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
(cherry picked from commit 1339168)
Signed-off-by: Sean Owen <[email protected]>1 parent 7881622 commit faf8dd5
File tree
2 files changed
+8
-4
lines changed- core/src
- main/java/org/apache/spark/unsafe/map
- test/java/org/apache/spark/unsafe/map
2 files changed
+8
-4
lines changedLines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
400 | 402 | | |
401 | 403 | | |
402 | 404 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
| 564 | + | |
| 565 | + | |
564 | 566 | | |
565 | 567 | | |
566 | 568 | | |
| |||
0 commit comments