jacques-n commented on a change in pull request #7214:
URL: https://github.com/apache/arrow/pull/7214#discussion_r613386671
##########
File path:
java/vector/src/main/java/org/apache/arrow/vector/complex/ListVector.java
##########
@@ -844,7 +844,7 @@ public void setValueCount(int valueCount) {
}
/* valueCount for the data vector is the current end offset */
final int childValueCount = (valueCount == 0) ? 0 :
- offsetBuffer.getInt((lastSet + 1) * OFFSET_WIDTH);
+ offsetBuffer.getInt(valueCount * OFFSET_WIDTH);
Review comment:
I think the bug was actually that last set is not updated just above
(fill the holes with offsets populates so more items are last set but doesn't
actually update the last set value). If the vector was internally consistent,
lastSet + 1 should be equal to valueCount. LastSet is zero-index and valuecount
is 1-index so I believe the fix is correct. I think, probably that lastSet
should also be updated at the end of the "fill the holes with offsets" section
as well.
--
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]