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

ListViewVector#getElementEndIndex Returns Size not Index #470

Open
nbauernfeind opened this issue Dec 27, 2024 · 4 comments · May be fixed by #554
Open

ListViewVector#getElementEndIndex Returns Size not Index #470

nbauernfeind opened this issue Dec 27, 2024 · 4 comments · May be fixed by #554
Assignees
Labels
good first issue Good for newcomers Type: bug Something isn't working

Comments

@nbauernfeind
Copy link
Contributor

nbauernfeind commented Dec 27, 2024

This method is incorrectly implemented:

  @Override
  public int getElementEndIndex(int index) {
    return sizeBuffer.getInt(index * OFFSET_WIDTH);
  }

https://github.com/apache/arrow-java/blob/main/vector/src/main/java/org/apache/arrow/vector/complex/ListViewVector.java#L957-L960

The javadoc indicates this is an offset not a length:

  /** Get data vector end index with the given list index. */
  int getElementEndIndex(int index);

This issue exists in main as of 480e1be.

@nbauernfeind nbauernfeind added the Type: bug Something isn't working label Dec 27, 2024
@vibhatha
Copy link
Contributor

vibhatha commented Jan 2, 2025

@nbauernfeind thanks for filing this issue. Would you like to make a PR?

@lidavidm lidavidm added the good first issue Good for newcomers label Jan 10, 2025
@joyCurry30
Copy link

Can you assign to me ? I'd like to make a PR.

@kou
Copy link
Member

kou commented Jan 14, 2025

Done!

@PURVANGIKA
Copy link

public int getElementEndIndex(int index) {
// Retrieve the offset from the offset buffer instead of sizeBuffer
return offsetBuffer.getInt((index + 1) * OFFSET_WIDTH);
}

joyCurry30 added a commit to joyCurry30/arrow-java that referenced this issue Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants