-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Description
Describe the enhancement requested
Current VectorAppender class is package-private.
This class provides utility methods for appending vector values fields that can be exposed publicly.
Java code:
package org.apache.arrow.vector.util;
import org.apache.arrow.memory.BufferAllocator;
import org.apache.arrow.memory.RootAllocator;
import org.apache.arrow.vector.IntVector;
import org.apache.arrow.vector.ValueVector;
public class FieldVectorAppender {
public static void main(String[] args) {
try (
BufferAllocator allocator = new RootAllocator();
IntVector initialValues = new IntVector("initialValues", allocator);
IntVector toAppend = new IntVector("toAppend", allocator);
) {
initialValues.allocateNew(2);
initialValues.set(0, 1);
initialValues.set(1, 2);
initialValues.setValueCount(2);
System.out.println("Initial IntVector: " + initialValues);
toAppend.allocateNew(4);
toAppend.set(1, 4);
toAppend.set(3, 6);
toAppend.setValueCount(4);
System.out.println("IntVector to Append: " + toAppend);
VectorAppender appenderUtil = new VectorAppender(initialValues);
ValueVector resultOfVectorsAppended = toAppend.accept(appenderUtil, null);
System.out.println("IntVector Result: " + resultOfVectorsAppended);
}
}
}Result:
Initial IntVector: [1, 2]
IntVector to Append: [null, 4, null, 6]
IntVector Result: [1, 2, null, 4, null, 6]Component(s)
Java