Hi Kevin,

You should use Phoenix commandline(squirrel) or Phoenix api to read data
written via Phoenix. One of the biggest advantage of Phoenix is that it
converts long, int, date, etc into a human readable format at the time of
displaying data(unlike binary in HBase). Have a look at Phoenix website to
find out how to use Phoenix to query data.

Thanks,
Anil

On Wed, Mar 16, 2016 at 8:13 AM, Sanooj Padmakumar <p.san...@gmail.com>
wrote:

> 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
> columns)
>
> byte[] startRow = ByteUtil.concat(PVarchar.INSTANCE
>                     .toBytes("primaryKeyCol1Value"),
> QueryConstants.SEPARATOR_BYTE_ARRAY,
>                     PVarchar.INSTANCE.toBytes("primaryKeyCol2Value");
>
> Get get = new Get(startRow);
> Result result = table.get(get);
>
> String colValue =
> Bytes.toString(result.getValue(Bytes.toBytes("colFamily"),
>                     Bytes.toBytes("colName")));
>
> Also read about PrefixFilter and range filters
>
> Hope this helps
>
> Sanooj
>
>
> On Tue, Mar 15, 2016 at 2:33 PM, kevin <kiss.kevin...@gmail.com> 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?
>>
>
>
>
> --
> Thanks,
> Sanooj Padmakumar
>



-- 
Thanks & Regards,
Anil Gupta

Reply via email to