@Test public void testDates() { Date now = new Date(); BufferAllocator bufferAllocator = new RootAllocator(Long.MAX_VALUE); TimeStampMilliVector timeStampMilliVector = ArrowConverter.vectorFor(bufferAllocator, "col1", new Date[]{now}); assertEquals(now.getTime(),timeStampMilliVector.get(0)); }
public static TimeStampMilliVector vectorFor(BufferAllocator allocator,String name,Date[] data) { TimeStampMilliVector float4Vector = new TimeStampMilliVector(name,allocator); float4Vector.allocateNew(data.length); for(int i = 0; i < data.length; i++) { float4Vector.setSafe(i,data[i].getTime()); } float4Vector.setValueCount(data.length); return float4Vector; }
ArrowConverter { public static TimeStampMilliVector vectorFor(BufferAllocator allocator,String name,Date[] data) { TimeStampMilliVector float4Vector = new TimeStampMilliVector(name,allocator); float4Vector.allocateNew(data.length); for(int i = 0; i < data.length; i++) { float4Vector.setSafe(i,data[i].getTime()); } float4Vector.setValueCount(data.length); return float4Vector; } }
ArrowConverter { public static TimeStampMilliVector vectorFor(BufferAllocator allocator,String name,Date[] data) { TimeStampMilliVector float4Vector = new TimeStampMilliVector(name,allocator); float4Vector.allocateNew(data.length); for(int i = 0; i < data.length; i++) { float4Vector.setSafe(i,data[i].getTime()); } float4Vector.setValueCount(data.length); return float4Vector; }  }
ArrowConverter { public static TimeStampMilliVector vectorFor(BufferAllocator allocator,String name,Date[] data) { TimeStampMilliVector float4Vector = new TimeStampMilliVector(name,allocator); float4Vector.allocateNew(data.length); for(int i = 0; i < data.length; i++) { float4Vector.setSafe(i,data[i].getTime()); } float4Vector.setValueCount(data.length); return float4Vector; }  static INDArray toArray(ArrowWritableRecordTimeSeriesBatch arrowWritableRecordBatch); static INDArray toArray(ArrowWritableRecordBatch arrowWritableRecordBatch); static INDArray convertArrowVector(FieldVector fieldVector,ColumnType type); static List<FieldVector> convertToArrowVector(INDArray from,List<String> name,ColumnType type,BufferAllocator bufferAllocator); static void writeRecordBatchTo(List<List<Writable>> recordBatch, Schema inputSchema,OutputStream outputStream); static void writeRecordBatchTo(BufferAllocator bufferAllocator ,List<List<Writable>> recordBatch, Schema inputSchema,OutputStream outputStream); static List<List<List<Writable>>> toArrowWritablesTimeSeries(List<FieldVector> fieldVectors,Schema schema,int timeSeriesLength); static ArrowWritableRecordBatch toArrowWritables(List<FieldVector> fieldVectors,Schema schema); static List<Writable> toArrowWritablesSingle(List<FieldVector> fieldVectors,Schema schema); static Pair<Schema,ArrowWritableRecordBatch> readFromFile(FileInputStream input); static Pair<Schema,ArrowWritableRecordBatch> readFromFile(File input); static Pair<Schema,ArrowWritableRecordBatch> readFromBytes(byte[] input); static org.apache.arrow.vector.types.pojo.Schema toArrowSchema(Schema schema); static Schema toDatavecSchema(org.apache.arrow.vector.types.pojo.Schema schema); static Field field(String name,ArrowType arrowType); static Field getFieldForColumn(String name,ColumnType columnType); static Field doubleField(String name); static Field floatField(String name); static Field intField(String name); static Field longField(String name); static Field stringField(String name); static Field booleanField(String name); static DictionaryProvider providerForVectors(List<FieldVector> vectors,List<Field> fields); static List<FieldVector> toArrowColumns(final BufferAllocator bufferAllocator, final Schema schema, List<List<Writable>> dataVecRecord); static List<FieldVector> toArrowColumnsTimeSeries(final BufferAllocator bufferAllocator,
                                                              final Schema schema,
                                                              List<List<List<Writable>>> dataVecRecord); static List<FieldVector> toArrowColumnsTimeSeriesHelper(final BufferAllocator bufferAllocator,
                                                                        final Schema schema,
                                                                        List<List<List<T>>> dataVecRecord); static List<FieldVector> toArrowColumnsStringSingle(final BufferAllocator bufferAllocator, final Schema schema, List<String> dataVecRecord); static List<FieldVector> toArrowColumnsStringTimeSeries(final BufferAllocator bufferAllocator,
                                                                    final Schema schema,
                                                                    List<List<List<String>>> dataVecRecord); static List<FieldVector> toArrowColumnsString(final BufferAllocator bufferAllocator, final Schema schema, List<List<String>> dataVecRecord); static void setValue(ColumnType columnType,FieldVector fieldVector,Object value,int row); static TimeStampMilliVector vectorFor(BufferAllocator allocator,String name,Date[] data); static TimeStampMilliVector timeVectorOf(BufferAllocator allocator,String name,int length); static VarBinaryVector vectorFor(BufferAllocator bufferAllocator,String name,INDArray[] data); static VarCharVector vectorFor(BufferAllocator allocator,String name,String[] data); static VarBinaryVector ndarrayVectorOf(BufferAllocator allocator,String name,int length); static VarCharVector stringVectorOf(BufferAllocator allocator,String name,int length); static Float4Vector vectorFor(BufferAllocator allocator,String name,float[] data); static Float4Vector floatVectorOf(BufferAllocator allocator,String name,int length); static Float8Vector vectorFor(BufferAllocator allocator,String name,double[] data); static Float8Vector doubleVectorOf(BufferAllocator allocator,String name,int length); static BitVector vectorFor(BufferAllocator allocator,String name,boolean[] data); static BitVector booleanVectorOf(BufferAllocator allocator,String name,int length); static IntVector vectorFor(BufferAllocator allocator,String name,int[] data); static IntVector intVectorOf(BufferAllocator allocator,String name,int length); static BigIntVector vectorFor(BufferAllocator allocator,String name,long[] data); static BigIntVector longVectorOf(BufferAllocator allocator,String name,int length); static Writable fromEntry(int item,FieldVector from,ColumnType columnType); }
ArrowConverter { public static TimeStampMilliVector vectorFor(BufferAllocator allocator,String name,Date[] data) { TimeStampMilliVector float4Vector = new TimeStampMilliVector(name,allocator); float4Vector.allocateNew(data.length); for(int i = 0; i < data.length; i++) { float4Vector.setSafe(i,data[i].getTime()); } float4Vector.setValueCount(data.length); return float4Vector; }  static INDArray toArray(ArrowWritableRecordTimeSeriesBatch arrowWritableRecordBatch); static INDArray toArray(ArrowWritableRecordBatch arrowWritableRecordBatch); static INDArray convertArrowVector(FieldVector fieldVector,ColumnType type); static List<FieldVector> convertToArrowVector(INDArray from,List<String> name,ColumnType type,BufferAllocator bufferAllocator); static void writeRecordBatchTo(List<List<Writable>> recordBatch, Schema inputSchema,OutputStream outputStream); static void writeRecordBatchTo(BufferAllocator bufferAllocator ,List<List<Writable>> recordBatch, Schema inputSchema,OutputStream outputStream); static List<List<List<Writable>>> toArrowWritablesTimeSeries(List<FieldVector> fieldVectors,Schema schema,int timeSeriesLength); static ArrowWritableRecordBatch toArrowWritables(List<FieldVector> fieldVectors,Schema schema); static List<Writable> toArrowWritablesSingle(List<FieldVector> fieldVectors,Schema schema); static Pair<Schema,ArrowWritableRecordBatch> readFromFile(FileInputStream input); static Pair<Schema,ArrowWritableRecordBatch> readFromFile(File input); static Pair<Schema,ArrowWritableRecordBatch> readFromBytes(byte[] input); static org.apache.arrow.vector.types.pojo.Schema toArrowSchema(Schema schema); static Schema toDatavecSchema(org.apache.arrow.vector.types.pojo.Schema schema); static Field field(String name,ArrowType arrowType); static Field getFieldForColumn(String name,ColumnType columnType); static Field doubleField(String name); static Field floatField(String name); static Field intField(String name); static Field longField(String name); static Field stringField(String name); static Field booleanField(String name); static DictionaryProvider providerForVectors(List<FieldVector> vectors,List<Field> fields); static List<FieldVector> toArrowColumns(final BufferAllocator bufferAllocator, final Schema schema, List<List<Writable>> dataVecRecord); static List<FieldVector> toArrowColumnsTimeSeries(final BufferAllocator bufferAllocator,
                                                              final Schema schema,
                                                              List<List<List<Writable>>> dataVecRecord); static List<FieldVector> toArrowColumnsTimeSeriesHelper(final BufferAllocator bufferAllocator,
                                                                        final Schema schema,
                                                                        List<List<List<T>>> dataVecRecord); static List<FieldVector> toArrowColumnsStringSingle(final BufferAllocator bufferAllocator, final Schema schema, List<String> dataVecRecord); static List<FieldVector> toArrowColumnsStringTimeSeries(final BufferAllocator bufferAllocator,
                                                                    final Schema schema,
                                                                    List<List<List<String>>> dataVecRecord); static List<FieldVector> toArrowColumnsString(final BufferAllocator bufferAllocator, final Schema schema, List<List<String>> dataVecRecord); static void setValue(ColumnType columnType,FieldVector fieldVector,Object value,int row); static TimeStampMilliVector vectorFor(BufferAllocator allocator,String name,Date[] data); static TimeStampMilliVector timeVectorOf(BufferAllocator allocator,String name,int length); static VarBinaryVector vectorFor(BufferAllocator bufferAllocator,String name,INDArray[] data); static VarCharVector vectorFor(BufferAllocator allocator,String name,String[] data); static VarBinaryVector ndarrayVectorOf(BufferAllocator allocator,String name,int length); static VarCharVector stringVectorOf(BufferAllocator allocator,String name,int length); static Float4Vector vectorFor(BufferAllocator allocator,String name,float[] data); static Float4Vector floatVectorOf(BufferAllocator allocator,String name,int length); static Float8Vector vectorFor(BufferAllocator allocator,String name,double[] data); static Float8Vector doubleVectorOf(BufferAllocator allocator,String name,int length); static BitVector vectorFor(BufferAllocator allocator,String name,boolean[] data); static BitVector booleanVectorOf(BufferAllocator allocator,String name,int length); static IntVector vectorFor(BufferAllocator allocator,String name,int[] data); static IntVector intVectorOf(BufferAllocator allocator,String name,int length); static BigIntVector vectorFor(BufferAllocator allocator,String name,long[] data); static BigIntVector longVectorOf(BufferAllocator allocator,String name,int length); static Writable fromEntry(int item,FieldVector from,ColumnType columnType);  }