You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by Jan Van Besien <ja...@gmail.com> on 2015/01/15 10:39:09 UTC

Potential bug with NULL array

Hi,

I think there is a bug in PArrayDataType, in the context of "store nulls".

The first line of the createPhoenixArray method tackles the case where
an empty byte array is interpreted as null. However, I think the check
should be

if (bytes == null || length == 0)

rather than

if (bytes == null || bytes.length == 0)

Now the method continues when the bytes.length != 0 but length == 0,
resulting in failures further on (invalid noOfElements being
calcluated or IllegalArgumentException in Buffer.position())

Can anyone confirm this is a bug, or am I missing something?

thanks
Jan

Re: Potential bug with NULL array

Posted by Jan Van Besien <ja...@gmail.com>.
I created PHOENIX-1587 and added a patch.

On Thu, Jan 15, 2015 at 10:39 AM, Jan Van Besien <ja...@gmail.com> wrote:
> Hi,
>
> I think there is a bug in PArrayDataType, in the context of "store nulls".
>
> The first line of the createPhoenixArray method tackles the case where
> an empty byte array is interpreted as null. However, I think the check
> should be
>
> if (bytes == null || length == 0)
>
> rather than
>
> if (bytes == null || bytes.length == 0)
>
> Now the method continues when the bytes.length != 0 but length == 0,
> resulting in failures further on (invalid noOfElements being
> calcluated or IllegalArgumentException in Buffer.position())
>
> Can anyone confirm this is a bug, or am I missing something?
>
> thanks
> Jan