-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-43577: [Java] getBuffers method needs correction on clear flag usage #43583
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
Conversation
|
I think this should be considered a breaking change |
|
Also, are we certain the original behavior wasn't intentional? How is clear currently used? |
Yes it is. Sorry I didn't make it. |
This came up in the |
|
If we allow this, we need to document and remind the user that when clear is true, there is a responsibility in clearing the retrieved buffers. |
Right, I pointed it out since it didn't make immediate sense. But I'm asking if the codebase gives a reason why clear works this way. It might not be obvious. |
|
Let me investigate this a little more. |
|
Looking into this, I think, clearing the buffers of the child vector might release memory that is still in use elsewhere. And this might lead to unexpected behavior or errors as we are explicitly enforcing a buffer clear on the extracted ones. Also, I think the clear was only meant to be used to clear the vector's buffer not its child buffers. But I feel like this is not precisely documented, as it only says "Return the underlying buffers associated with this vector". |
|
Reconsidering my position, I would like to propose a documentation update and reverting the change made for |
|
Sounds good to me. Thanks for looking! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lidavidm I didn't add the LargeList and LargeListView as LargeList wasn't there in the first place.
java/vector/src/main/java/org/apache/arrow/vector/complex/AbstractStructVector.java
Outdated
Show resolved
Hide resolved
|
@lidavidm I updated the PR with the doc change. |
|
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 4d200dc. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
…ag usage (apache#43583) ### Rationale for this change `getBuffers` method provides the capability to clear the buffers in the vector, this has not been properly tested while clear flag is not properly used in the implementation across various types of vectors. ### What changes are included in this PR? Updating the vector `getBuffers` method to use `clear` flag as expected and adding corresponding test cases. ### Are these changes tested? Yes, via existing test cases and new test cases. ### Are there any user-facing changes? Yes * GitHub Issue: apache#43577 Authored-by: Vibhatha Abeykoon <[email protected]> Signed-off-by: David Li <[email protected]>
Rationale for this change
getBuffersmethod provides the capability to clear the buffers in the vector, this has not been properly tested while clear flag is not properly used in the implementation across various types of vectors.What changes are included in this PR?
Updating the vector
getBuffersmethod to useclearflag as expected and adding corresponding test cases.Are these changes tested?
Yes, via existing test cases and new test cases.
Are there any user-facing changes?
Yes
getBuffersmethod needs correction onclearflag usage #43577