Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

PHOENIX INTEGER stored into HBASE

avatar
New Contributor

Hi ,

I have create table via Phoenix with primary key INTEGER

 

 

create table if not exists BEN.TEST_INT
(
my_int INTEGER PRIMARY KEY,
my_json VARCHAR)

 

and insert a data

 

 

 

UPSERT INTO BEN.TEST_INT values (1000000, '{"a": 1}')

 

 

 

and the result:

 

 

select * from  BEN.TEST_INT
WHERE MY_INT = 1000000

 

 

 

MY_INTMY_JSON
1000000

{"a": 1}

 

BUT under HBASE the value are stored as Binary.

 

 

hbase(main):005:0> scan 'BEN:TEST_INT'
ROW                                                   COLUMN+CELL
 \x80\x0FB@                                           column=0:MY_JSON, timestamp=1609912042222, value={"a": 1}
 \x80\x0FB@                                           column=0:_0, timestamp=1609912042222, value=x
1 row(s) in 0.0280 seconds

 

 

 

image.png

 

 
 
 

can some help please

1 REPLY 1

avatar
Master Collaborator

Hi @Ben621 ,

Please check this community post should answer your question.

https://community.cloudera.com/t5/Support-Questions/How-are-the-primary-keys-in-Phoenix-are-converte...

 

Regards,

Will

If the answer helps, please accept as solution and click thumbs up.