0
votes

I am using HBase-1.1 and Phoenix-4.7. I created a table in HBase and inserted a sample value and trying to query based on the inserted value from Phoenix.

I used the following query in HBase to create and insert table data

create 'T1', {NAME => 'F1', IS_MOB => true}
put 'MOBPHOENIXTEST', '1', 'F1:value', 'Initial Value'

And created a Phoenix table to view the HBase data as follows

CREATE TABLE t1 ( pk VARCHAR PRIMARY KEY, f1."value" VARCHAR )

also tried with this create query

CREATE TABLE t1 ( pk VARCHAR PRIMARY KEY, value VARCHAR )

But I couldn't able to see the row inserted in HBase when running the following select query

select * from t1;

Note: I don't want to create a Phoenix view for HBase table 'T1'. Because I can also insert data to HBase from Phoenix. When I create a view, I can able to see the data from Phoenix but I couldn't able to insert a row using this view.

1

1 Answers

1
votes

Because of some datatype incompatibility between Hbase and Phoenix, it is not possible to view the data which is already present in the Hbase table that was inserted using the Hbase shell.

However, instead of creating a view in Phoenix, you can create a table with the same name of the existing Hbase table. This will allow you to insert data into the table which can be retrieved by using Phoenix as well as Hbase.

Please note that only the data which was stored in the VARCHAR format from Phoenix can be retrieved as is in Hbase. You might get non-readable data or data with some hexadecimal values when you try to retrieve data of other datatypes.