+1 on the idea of enhancing builder interfaces.

>>IntVectorBuilder addAll(int[] values);

Let's make sure that anything like the above is efficient. People will
judge the quality of the project on the efficiency of the methods we
provide. If everybody starts using int[] to build Arrow vectors, we should
make sure it is good. The complexwriter tries to be dynamically typed in a
statically typed language and had to give up some efficiency. For methods
where we're adding multiple values (as above), we should make sure to
improve the layers to maximize things.

On Thu, Oct 24, 2019 at 3:08 AM Fan Liya <liya.fa...@gmail.com> wrote:

> 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);
> > }
> >
>

Reply via email to