phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas D'Silva" <tdsi...@salesforce.com>
Subject Re: How are Phoenix Arrays Stored in HBase?
Date Fri, 19 Oct 2018 21:48:51 GMT
Take a look at PArrayDataTypeEncoder appendValue() and encode(). For
variable length data types  we store the individual element's serialized
bytes with a separator and the the last part of the array contains the
offsets.
For fixed length data types we just store the individual elements.

On Fri, Oct 19, 2018 at 2:40 PM, William Shen <willshen@marinsoftware.com>
wrote:

> Hi,
>
> Sorry if this is too basic of a question. I tried to look through the
> documentation but could not find the information. How are Phoenix Arrays
> stored in HBase, and in particular, how are varchar array stored?
>
> I tried to upsert data in phoenix, and compare the HBase value:
>
> '0' *0*\x00\x00\x00\x80\x01\x00\x00\x00\x04\x00\x00\x00\x01\x01
> '0', '0' 0\x000\x00\x00\x00\x80\x01\x80\x03\x00\x00\x00\x06\x00\x00\x00
> \x02\x01
> '1', '1' 1\x001\x00\x00\x00\x80\x01\x80\x03\x00\x00\x00\x06\x00\x00\x00
> \x02\x01
> '1', '23' 1\x0023\x00\x00\x00\x80\x01\x80\x03\x00\x00\x00\x07\x00\x00\x00
> \x02\x01
> [''] \x00\x00\x80\x01\x00\x00\x00\x02\x00\x00\x00\x01\x01
> ['', ''] \x00\x00\x80\x01\x80\x01\x00\x00\x00\x02\x00\x00\x00\x02\x01
>
> I was able to deduce that the varchar is stored with a zero byte
> terminator, and I think there is another part tracking how many items are
> in an array, but I could not quite figure out the array information in hex
> that follows... Can someone help me understand how the array is stored in
> HBase?
>
> Thank you!
>

Mime
View raw message