Re: [DISCUSS][JAVA] Correct the behavior of ListVector isEmpty

2020-01-27 Thread Bryan Cutler
Return a null might be more correct since `getObject(int index)` also
return a null value if not set, but I don't think it's worth making a more
complicated API for this. It should be fine to return `false` for a null
value.
+1 for treating nulls as empty.

On Fri, Jan 24, 2020 at 9:12 AM Brian Hulette  wrote:

> What about returning null for a null list? It looks like now the function
> returns a primitive boolean, so I guess that would be a substantial change,
> but null seems more correct to me.
>
> On Thu, Jan 23, 2020, 21:38 Micah Kornfield  wrote:
>
> >  I would vote for treating nulls as empty.
> >
> > On Fri, Jan 10, 2020 at 12:36 AM Ji Liu 
> > wrote:
> >
> > > Hi all,
> > >
> > > Currently isEmpty API is always return false in
> BaseRepeatedValueVector,
> > > and its subclass ListVector did not overwrite this method.
> > > This will lead to incorrect result, for example, a ListVector with data
> > > [1,2], null, [], [5,6] would get [false, false, false, false] which is
> > not
> > > right.
> > > I opened a PR to fix this[1] and not sure what’s the right behavior for
> > > null value, should it return [false, false, true, false] or [false,
> true,
> > > true, false] ?
> > >
> > >
> > > Thanks,
> > > Ji Liu
> > >
> > >
> > > [1] https://github.com/apache/arrow/pull/6044
> > >
> > >
> >
>


Re: [DISCUSS][JAVA] Correct the behavior of ListVector isEmpty

2020-01-24 Thread Brian Hulette
What about returning null for a null list? It looks like now the function
returns a primitive boolean, so I guess that would be a substantial change,
but null seems more correct to me.

On Thu, Jan 23, 2020, 21:38 Micah Kornfield  wrote:

>  I would vote for treating nulls as empty.
>
> On Fri, Jan 10, 2020 at 12:36 AM Ji Liu 
> wrote:
>
> > Hi all,
> >
> > Currently isEmpty API is always return false in BaseRepeatedValueVector,
> > and its subclass ListVector did not overwrite this method.
> > This will lead to incorrect result, for example, a ListVector with data
> > [1,2], null, [], [5,6] would get [false, false, false, false] which is
> not
> > right.
> > I opened a PR to fix this[1] and not sure what’s the right behavior for
> > null value, should it return [false, false, true, false] or [false, true,
> > true, false] ?
> >
> >
> > Thanks,
> > Ji Liu
> >
> >
> > [1] https://github.com/apache/arrow/pull/6044
> >
> >
>


Re: [DISCUSS][JAVA] Correct the behavior of ListVector isEmpty

2020-01-23 Thread Micah Kornfield
 I would vote for treating nulls as empty.

On Fri, Jan 10, 2020 at 12:36 AM Ji Liu  wrote:

> Hi all,
>
> Currently isEmpty API is always return false in BaseRepeatedValueVector,
> and its subclass ListVector did not overwrite this method.
> This will lead to incorrect result, for example, a ListVector with data
> [1,2], null, [], [5,6] would get [false, false, false, false] which is not
> right.
> I opened a PR to fix this[1] and not sure what’s the right behavior for
> null value, should it return [false, false, true, false] or [false, true,
> true, false] ?
>
>
> Thanks,
> Ji Liu
>
>
> [1] https://github.com/apache/arrow/pull/6044
>
>