viirya commented on code in PR #40043:
URL: https://github.com/apache/arrow/pull/40043#discussion_r1488754966
##########
java/vector/src/main/java/org/apache/arrow/vector/BaseVariableWidthVector.java:
##########
@@ -476,11 +507,12 @@ private void allocateBytes(final long valueBufferSize,
final int valueCount) {
}
/* allocate offset buffer */
- private void allocateOffsetBuffer(final long size) {
+ private ArrowBuf allocateOffsetBuffer(final long size) {
Review Comment:
> > I don't think an inconsistent offset (sometimes it is empty sometimes it
is one value buffer) is a good idea. Very confused and easy to cause bugs.
>
> Code shouldn't make assumptions because we've already documented that
those assumptions are wrong. It would be equally true for code working with
imported arrays: they may have a one value buffer.
Hmm, but this is the current code status...
You can see how these var-size vectors handle offset buffer, they assume
that the initial capacity of offset buffer is 0. That's why I got some many
test failure after I changed the initial offset buffer.
--
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]