GH-43577: [Java] getBuffers method needs correction on clear flag usage#43583
GH-43577: [Java] getBuffers method needs correction on clear flag usage#43583lidavidm merged 4 commits intoapache:mainfrom
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.
@lidavidm I didn't add the LargeList and LargeListView as LargeList wasn't there in the first place.
|
@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 <vibhatha@gmail.com> Signed-off-by: David Li <li.davidm96@gmail.com>
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