ViggoC commented on code in PR #886:
URL: https://github.com/apache/arrow-java/pull/886#discussion_r2465559652
##########
vector/src/main/java/org/apache/arrow/vector/validate/ValidateVectorBufferVisitor.java:
##########
@@ -158,7 +158,15 @@ public Void visit(BaseLargeVariableWidthVector vector,
Void value) {
@Override
public Void visit(BaseVariableWidthViewVector vector, Void value) {
- throw new UnsupportedOperationException("View vectors are not supported.");
+ final int valueCount = vector.getValueCount();
+ validateOrThrow(
+ vector.getValueCount() >= 0,
+ "Vector valueCount %s is negative.",
+ vector.getValueCapacity());
Review Comment:
How do you think `validateVectorCommon` should be modified to support
`StringView`? My idea is
``` Java
if (vector instanceof BaseVariableWidthViewVector) {
int typeBufferCount = TypeLayout.getTypeBufferCount(arrowType);
validateOrThrow(
fieldVector.getFieldBuffers().size() >= typeBufferCount,
"Expected at least %s buffers in vector of type %s, got %s.",
typeBufferCount,
vector.getField().getType().toString(),
fieldVector.getFieldBuffers().size());
}
```
--
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]