Hi Micah, IMO, we need an adapter from on-heap array to off-heap array. This is useful because many third-party Java libraries populate data to an on-heap array.
And I see this API in your design: IntVectorBuilder addAll(int[] values); So I am +1 for this. Best, Liya Fan On Thu, Oct 24, 2019 at 12:31 PM Micah Kornfield <emkornfi...@gmail.com> wrote: > As part a PR Ji Liu has made to help populate data for test cases [1], the > question came up on whether we should provide a more builder classes in > java for ValueVectors. The proposed implementation would wrap the existing > Writer classes. > > Do people think this would be a valuable addition to the java library? I > imagine it would be a builder per ValueVectorType. The main benefit I see > to this is making the library potentially slightly easier to use for > new-comers, but might not be the most efficient. A straw-man interface is > listed below. > > Thoughts? > > Thanks, > Micah > > class IntVectorBuilder { > public IntVectorBuilder(BufferAllocator allocator); > > IntVectorBuilder add(int value); > IntVectorBuilder addAll(int[] values); > IntVectorBuilder addNull(); > // handles null values in array > IntVectorBuilder addAll(Integer... values); > IntVectorBuilder addAll(List<Integer> values); > IntVector build(String name); > } >