phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sanooj Padmakumar <>
Subject Re: how to decode phoenix data under hbase
Date Wed, 16 Mar 2016 15:13:24 GMT
Hi Kevin,

You can access the data created using phoenix with java hbase api .. Use
the sample code below..

Keep in mind for varchar (i.e. for columns whose size is unknown phoenix
uses separator) based columns we need to use
QueryConstants.SEPARATOR_BYTE_ARRAY as the separator and for number based
columns we dont need any separator (since phoenix keeps fixed size for such

byte[] startRow = ByteUtil.concat(PVarchar.INSTANCE

Get get = new Get(startRow);
Result result = table.get(get);

String colValue = Bytes.toString(result.getValue(Bytes.toBytes("colFamily"),

Also read about PrefixFilter and range filters

Hope this helps


On Tue, Mar 15, 2016 at 2:33 PM, kevin <> wrote:

> HI,all
>     I create a table under phoenix and upsert somedata. I turn to hbase
> client and scan the new table.
>     I got data like :
>     column=0:NAME, timestamp=1458028540810, value=\xE5\xB0\x8F\xE6\x98\x8E
>     I don't know how to decode the value to normal string.what's the
> codeset?

Sanooj Padmakumar

View raw message