public static List < FieldVector > toArrowColumns ( final BufferAllocator bufferAllocator , final Schema schema , List < List < Writable > > dataVecRecord ) { int numRows = dataVecRecord . size ( ) ; List < FieldVector > ret = createFieldVectors ( bufferAllocator , schema , numRows ) ; for ( int j = 0 ; j < schema . numColumns ( ) ; j ++ ) { FieldVector fieldVector = ret . get ( j ) ; int row = 0 ; for ( List < Writable > record : dataVecRecord ) { Writable writable = record . get ( j ) ; setValue ( schema . getType ( j ) , fieldVector , writable , row ) ; row ++ ; } } return ret ; }
Given a buffer allocator and datavec schema convert the passed in batch of records to a set of arrow columns