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

[Java] Getting length of data buffer and base variable width vector #24361

Closed
asfimport opened this issue Mar 19, 2020 · 5 comments
Closed

[Java] Getting length of data buffer and base variable width vector #24361

asfimport opened this issue Mar 19, 2020 · 5 comments

Comments

@asfimport
Copy link

For string data buffer and base variable width vector can we have a way to get length of the data? 

For instance, in ArrowColumnVector in StringAccessor we use stringResult.start and stringResult.end, instead we would like to get length of the data through an exposed function.

Reporter: Gaurangi Saxena
Assignee: Ji Liu / @tianchen92

PRs and other links:

Note: This issue was originally created as ARROW-8158. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Ji Liu / @tianchen92:
Hi, I think one could get valid data length by BaseVariableWidthVector#sizeOfValueBuffer.

https://github.com/apache/arrow/blob/master/java/vector/src/main/java/org/apache/arrow/vector/BaseVariableWidthVector.java#L582

@asfimport
Copy link
Author

Micah Kornfield / @emkornfield:
@tianchen92  The issue is there isn't a clear way to get the length of an individual VarChar or Bytes element (one needs to go through the holder or access the offsets buffer directly).  A similar issue exists for lists.

@asfimport
Copy link
Author

Ji Liu / @tianchen92:
@emkornfield  I see, I could add a method like getDataLength(int index) for variable width vector.

For lists, we already have getElementStartIndex/getElementEndIndex, is it enough or still need to add a method like getElementLength?

@asfimport
Copy link
Author

Micah Kornfield / @emkornfield:
we should probably be consistent and have getEndIndex or something like that instead of length.

@asfimport
Copy link
Author

Micah Kornfield / @emkornfield:
Issue resolved by pull request 6684
#6684

@asfimport asfimport added this to the 0.17.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants