ConeyLiu commented on code in PR #13815:
URL: https://github.com/apache/arrow/pull/13815#discussion_r941964166
##########
java/vector/src/main/java/org/apache/arrow/vector/BaseVariableWidthVector.java:
##########
@@ -1250,8 +1251,10 @@ protected final void handleSafe(int index, int
dataLength) {
while (index >= getValueCapacity()) {
reallocValidityAndOffsetBuffers();
}
- final int startOffset = lastSet < 0 ? 0 : getStartOffset(lastSet + 1);
- while (valueBuffer.capacity() < (startOffset + dataLength)) {
+ final long startOffset = lastSet < 0 ? 0 : getStartOffset(lastSet + 1);
+ final long targetCapacity = startOffset + dataLength;
+ checkDataBufferSize(targetCapacity);
+ while (valueBuffer.capacity() < targetCapacity) {
reallocDataBuffer();
}
Review Comment:
Got your point. And updated the code. It should be the right way.
--
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]