fabiencelier opened a new issue #9636:
URL: https://github.com/apache/arrow/issues/9636


   Hello,
   
   I am receiving a `ListVector` wrapping a `Float8Vector` and I'd like to 
deserialize them into Java `double[]` (each array has 1000 elements).
   
   At the moment I do the following:
   
   ```java
   public static List<double[]> deserialize(ListVector listVector) {
     final Float8Vector underlying = (Float8Vector) listVector.getDataVector();
     final List<double[]> deserialized = new ArrayList<>();
     for (int index = 0; index < listVector.getValueCount(); index++) {
       final int first = listVector.getElementStartIndex(index);
       final int last = listVector.getElementEndIndex(index);
       final int size = last - first;
       double[] data = new double[size];
       for (int i = 0; i < size; i++) {
         data[i] = underlying.get(first + i);
       }
     }
     return deserialized;
   }
   ```
   
   But it feels inefficient to retrieve the values one by one, is there a way 
to get all the values between `first` and `last` directly into a `double[]` 
with one call ?


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to