axreldable commented on issue #470:
URL: https://github.com/apache/arrow-java/issues/470#issuecomment-3904516752
> public int getElementEndIndex(int index) { // Retrieve the offset from the
offset buffer instead of sizeBuffer return offsetBuffer.getInt((index + 1) *
OFFSET_WIDTH); }
It works for `ListVector`, but it doesn't work for `ListViewVector`, as
offsets can be out of order according to the
[specification](https://arrow.apache.org/docs/format/Intro.html#list-view). So
we need to determine the end index of the element based on its offset and size.
```
public int getElementEndIndex(int index) {
return offsetBuffer.getInt(index * OFFSET_WIDTH) + sizeBuffer.getInt(index
* SIZE_WIDTH);
}
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]