davisusanibar opened a new issue, #37246:
URL: https://github.com/apache/arrow/issues/37246

   ### Describe the enhancement requested
   
   Current 
[VectorAppender](https://github.com/apache/arrow/blob/main/java/vector/src/main/java/org/apache/arrow/vector/util/VectorAppender.java)
 class is package-private.
   
   This class provides utility methods for appending vector values fields that 
can be exposed publicly.
   
   Java code:
   
   ```java
       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:
   ```shell
       Initial IntVector: [1, 2]
       IntVector to Append: [null, 4, null, 6]
       IntVector Result: [1, 2, null, 4, null, 6]
   ```
   
   ### Component(s)
   
   Java


-- 
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]

Reply via email to