srowen commented on a change in pull request #30728:
URL: https://github.com/apache/spark/pull/30728#discussion_r543435552
##########
File path: core/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java
##########
@@ -300,7 +300,8 @@ private void advanceToNextPage() {
@Override
public boolean hasNext() {
if (numRecords == 0) {
- if (reader != null) {
+ // hasNext maybe called multiple times. Let's guard that
+ if (reader != null && spillWriters.size() > 0) {
Review comment:
Yeah that looks a little more direct and tidy, if it also solves the
issue.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]