Skip to content

GH-470: ListViewVector#getElementEndIndex should returns size not index #554

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

joyCurry30
Copy link

Close #470

@kou kou changed the title [GH-470]ListViewVector#getElementEndIndex should returns size not index. GH-470: ListViewVector#getElementEndIndex should returns size not index. Jan 23, 2025
@kou kou changed the title GH-470: ListViewVector#getElementEndIndex should returns size not index. GH-470: ListViewVector#getElementEndIndex should returns size not index Jan 23, 2025
@@ -956,7 +956,7 @@ public int getElementStartIndex(int index) {

@Override
public int getElementEndIndex(int index) {
return sizeBuffer.getInt(index * OFFSET_WIDTH);
return offsetBuffer.getInt((index + 1) * OFFSET_WIDTH);
Copy link
Member

Choose a reason for hiding this comment

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

Should line 954 be changed together? BTW, are these methods covered by any unit test?

Copy link
Member

Choose a reason for hiding this comment

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

To answer my 1st question: no.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see any unit tests for it; and if possible would be worth a small one.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, the fact that tests passed means nothing's covering it. Unfortunately the new types were only partially implemented before the contributor left.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Good suggest. I will add UT for it.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the end index be offset + size + 1? (Assuming noninclusive)

@nbauernfeind
Copy link
Contributor

@joyCurry30 Thank you so much for taking care of this!

This comment has been minimized.

@joyCurry30
Copy link
Author

joyCurry30 commented Mar 11, 2025

I am sorry for silence for so long. I have just add the ut for ListViewVector#getElementEndIndex. Could you please take a look when you are free? I'd be happy to address any feedback or make further improvement if needed. @nbauernfeind @wgtmac

@lidavidm lidavidm added the bug-fix PRs that fix a big. label Mar 11, 2025
@github-actions github-actions bot added this to the 18.3.0 milestone Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix PRs that fix a big.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ListViewVector#getElementEndIndex Returns Size not Index
4 participants