Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TISPARK-45] Fix ScanIterator logic where index may be out of bound #357

Merged
merged 2 commits into from
Jun 1, 2018

Conversation

birdstorm
Copy link
Contributor

In previous implementation, if index is not initialized, IndexOutOfBoundsException would be thrown.

@birdstorm
Copy link
Contributor Author

/run-all-tests

@@ -115,8 +115,7 @@ public boolean hasNext() {
if (!loadCache()) {
endOfRegion = true;
Copy link
Contributor Author

@birdstorm birdstorm May 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should return false here. Since endOfRegion is true, hasNext should be false. @ilovesoup

@@ -115,8 +115,7 @@ public boolean hasNext() {
if (!loadCache()) {
endOfRegion = true;
}
}
if (!contains(currentCache.get(index).getKey())) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here if index is not initialized, it will remain -1 so IndexOutOfBoundsException will be thrown.

@birdstorm birdstorm requested a review from zhexuany June 1, 2018 05:09
Copy link
Contributor

@zhexuany zhexuany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhexuany zhexuany merged commit a21ea47 into master Jun 1, 2018
@zhexuany zhexuany deleted the fix_scanIterator branch June 1, 2018 05:28
wfxxh pushed a commit to wanfangdata/tispark that referenced this pull request Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants