You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by ashish tapdiya <as...@gmail.com> on 2014/07/30 04:19:54 UTC

Regarding rowkey encoding in Phoenix as compared to HBase

Hi

I have created a table using Phoenix. The key type is integer. When I
insert a row from phoenix with key value 55 and scan the table from HBase
shell I get key value as \x80\x00\x007

I created another table using HBase shell and inserted row with key value
55. Scanning the table shows that the key is stored as \x00\x00\x007.

Wondering if Phoenix makes any changes to the key before storing. How can I
access the tables created in Phoenix using HBase API.

Thanks,
~Ashish

Re: Regarding rowkey encoding in Phoenix as compared to HBase

Posted by Abhilash L L <ab...@capillarytech.com>.
@Ashish
Phoenix flips the sign bit, so that negative numbers are sorted before
positive values

Refer http://phoenix.apache.org/language/datatypes.html for more details.


Regards,
Abhilash L L
Capillary Technologies
M:919886208262
abhilash@capillarytech.com | www.capillarytech.com

Email from people at capillarytech.com may not represent official policy of
 Capillary Technologies unless explicitly stated. Please see our
Corporate-Email-Policy
<http://support.capillary.co.in/policy-public/Corporate-Email-Policy.pdf>
for details. Contents of this email are confidential. Please contact the
Sender if you have received this email in error.



On Wed, Jul 30, 2014 at 10:10 AM, yinxl@shencai.cc <yi...@shencai.cc> wrote:

> in java, you can use as this:
> byte [] rk = org.apache.phoenix.schema.PDataType.INTEGER.toBytes(rowkey);
>
> ------------------------------
> yinxl@shencai.cc
>
>
> *From:* ashish tapdiya <as...@gmail.com>
> *Date:* 2014-07-30 10:19
> *To:* user <us...@phoenix.apache.org>
> *Subject:* Regarding rowkey encoding in Phoenix as compared to HBase
> Hi
>
> I have created a table using Phoenix. The key type is integer. When I
> insert a row from phoenix with key value 55 and scan the table from HBase
> shell I get key value as \x80\x00\x007
>
> I created another table using HBase shell and inserted row with key value
> 55. Scanning the table shows that the key is stored as \x00\x00\x007.
>
> Wondering if Phoenix makes any changes to the key before storing. How can
> I access the tables created in Phoenix using HBase API.
>
> Thanks,
> ~Ashish
>
>

-- 
Email from people at capillarytech.com may not represent official policy of 
Capillary Technologies unless explicitly stated. Please see our 
Corporate-Email-Policy for details.Contents of this email are confidential. 
Please contact the Sender if you have received this email in error.

Re: Regarding rowkey encoding in Phoenix as compared to HBase

Posted by "yinxl@shencai.cc" <yi...@shencai.cc>.
Hi

I have created a table using Phoenix. The key type is integer. When I
insert a row from phoenix with key value 55 and scan the table from HBase
shell I get key value as \x80\x00\x007

I created another table using HBase shell and inserted row with key value
55. Scanning the table shows that the key is stored as \x00\x00\x007.

Wondering if Phoenix makes any changes to the key before storing. How can I
access the tables created in Phoenix using HBase API.

Thanks,
~Ashish