lidavidm commented on code in PR #41930:
URL: https://github.com/apache/arrow/pull/41930#discussion_r1623695349
##########
java/c/src/main/java/org/apache/arrow/c/StructVectorLoader.java:
##########
@@ -111,7 +111,7 @@ private void loadBuffers(FieldVector vector, Field field,
Iterator<ArrowBuf> buf
ArrowFieldNode fieldNode = nodes.next();
// variadicBufferLayoutCount will be 0 for vectors of type except
BaseVariableWidthViewVector
long variadicBufferLayoutCount = 0;
- if (variadicBufferCounts != null) {
+ if (variadicBufferCounts.hasNext()) {
Review Comment:
I think you can only advance the iterator when the type is actually
VarCharView
##########
java/vector/src/main/java/org/apache/arrow/vector/VectorLoader.java:
##########
@@ -106,7 +107,7 @@ private void loadBuffers(
ArrowFieldNode fieldNode = nodes.next();
// variadicBufferLayoutCount will be 0 for vectors of type except
BaseVariableWidthViewVector
long variadicBufferLayoutCount = 0;
- if (variadicBufferCounts != null) {
+ if (variadicBufferCounts.hasNext()) {
Review Comment:
Ditto
##########
java/vector/src/test/java/org/apache/arrow/vector/TestValueVector.java:
##########
@@ -3398,4 +3402,60 @@ public void testSetGetUInt4() {
assertEquals(expected, vector.getValueAsLong(1));
}
}
+
+ @Test
+ public void testVectorLoadUnloadOnNonVariadicVectors() {
Review Comment:
Let's see a test with mixed variadic/non-variadic types (also preferably
nested types)
--
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]