phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacobo Coll <>
Subject Re: Reading Phoenix Upserted data directly from Hbase
Date Mon, 04 Dec 2017 13:43:06 GMT
You could read the values using the different PDataType in java. You only
need to know the type of data stored in every column.

byte[] value;

Integer anInt = (Integer) PInteger.INSTANCE.toObject(value);
Array array = (Array) PVarcharArray.INSTANCE.toObject(value);

Reading multiple values from the RowKey is more complicated, as they are
concatenated, and you have to deal with nullable values and separators..
but if it only contains one value, is the same procedure.

I hope this helps,
Jacobo Coll

2017-12-04 11:25 GMT+00:00 Vaghawan Ojha <>:

> Thank you very much for the response, it helps. So I'm guessing there is
> no way to read the data from hbase directly which are inserted through
> phoenix.
> Thanks
> Vaghawan
> On Sat, Dec 2, 2017 at 1:20 AM, Sergey Soldatov <>
> wrote:
>> HBase doesn't know about data types that you are using in Phoenix. So it
>> operates with binary arrays. HBase shell shows printable ASCII characters
>> as is and hex values for the rest. You may use spark-phoenix module to work
>> with Phoenix from Spark.
>> Thanks,
>> Sergey
>> On Thu, Nov 30, 2017 at 11:22 PM, Vaghawan Ojha <>
>> wrote:
>>> Hi,
>>> I've few phoenix tables created from Phoenix itself, they do fine with
>>> the Phoenix, however, when I try to scan the data from hbase shell, the
>>> binary strings get printed instead of the real values, like the one I can
>>> see in the phoenix.
>>> Also, there are cases when I want to fetch them directly from hbase and
>>> work with spark. I guess I'm doing something wrong with the configuration
>>> of phoenix, or is this the expected result?
>>> I'm using phoenix-4.12.0-HBase-1.2 .
>>> Any reply would be appreciated.
>>> Thanks

View raw message