You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by Krishna <re...@gmail.com> on 2014/10/16 20:59:09 UTC

How does Phoenix treat null values?

Hi,

If a table has following data:
----------------------------------------------
RowKey | cf.a    | cf.b         | cf.c
----------------------------------------------
RowKey1 | abc   | <null> | 123
RowKey2 | abc    | def | <null>
----------------------------------------------

How is data stored in HFiles for the table above (assuming I did not upsert
null values for cf.b and cf.c) ? Is it Option-I or Option-II?

*Option-I:*
RowKey1, cf.a, 'abc'
RowKey1, cf.b, <null>
RowKey1, cf.c, '123'
RowKey1, 0, <null>
RowKey2, cf.a, 'abc'
RowKey2, cf.b, 'def'
RowKey2, cf.c, <null>
RowKey2, 0, <null>

*Option-II:*
RowKey1, cf.a, 'abc'
RowKey1, cf.c, '123'
RowKey1, 0, <null>
RowKey2, cf.a, 'abc'
RowKey2, cf.b, 'def'
RowKey2, 0, <null>

Thanks

Re: How does Phoenix treat null values?

Posted by Krishna <re...@gmail.com>.
Very simple to check this through hbase shell; its Option II since HFile
storage is driven by HBase and not Phoenix.


On Thu, Oct 16, 2014 at 11:59 AM, Krishna <re...@gmail.com> wrote:

> Hi,
>
> If a table has following data:
> ----------------------------------------------
> RowKey | cf.a    | cf.b         | cf.c
> ----------------------------------------------
> RowKey1 | abc   | <null> | 123
> RowKey2 | abc    | def | <null>
> ----------------------------------------------
>
> How is data stored in HFiles for the table above (assuming I did not
> upsert null values for cf.b and cf.c) ? Is it Option-I or Option-II?
>
> *Option-I:*
> RowKey1, cf.a, 'abc'
> RowKey1, cf.b, <null>
> RowKey1, cf.c, '123'
> RowKey1, 0, <null>
> RowKey2, cf.a, 'abc'
> RowKey2, cf.b, 'def'
> RowKey2, cf.c, <null>
> RowKey2, 0, <null>
>
> *Option-II:*
> RowKey1, cf.a, 'abc'
> RowKey1, cf.c, '123'
> RowKey1, 0, <null>
> RowKey2, cf.a, 'abc'
> RowKey2, cf.b, 'def'
> RowKey2, 0, <null>
>
> Thanks
>
>