liyafan82 commented on a change in pull request #7837:
URL: https://github.com/apache/arrow/pull/7837#discussion_r464392286
##########
File path:
java/algorithm/src/main/java/org/apache/arrow/algorithm/sort/FixedWidthOutOfPlaceVectorSorter.java
##########
@@ -44,6 +45,13 @@ public void sortOutOfPlace(V srcVector, V dstVector,
VectorValueComparator<V> co
ArrowBuf dstValidityBuffer = dstVector.getValidityBuffer();
ArrowBuf dstValueBuffer = dstVector.getDataBuffer();
+ // check buffer size
+ Preconditions.checkArgument(dstValidityBuffer.capacity() * 8 >=
srcVector.getValueCount(),
+ "No enough capacity for the validity buffer of the dst vector");
Review comment:
Good point. Thank you.
I have revised the code accordingly.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]