I'm new to HBase and Phoenix. I have problem mapping an existing HBase table into phoenix. My ultimate intent here is that I should be able to update existing rows of the HBase table as well as insert new rows into it using Phoenix SQL. My table in HBASE looks like this (it has five columns under the column family CASEDETAILS):
CASES
COLUMN FAMILIES DESCRIPTION
{NAME => 'CASEDETAILS', BLOOMFILTER => 'NONE', VERSIONS => '2', IN_MEMORY =>
'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL
=> 'FOREVER',COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE =>
'false', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}
When I create a view over this table using the command
create view CASES( pk VARCHAR PRIMARY KEY,
CASEDETAILS.CASEID VARCHAR,
CASEDETAILS.CREATED VARCHAR,
CASEDETAILS.CREATEDBY VARCHAR,
CASEDETAILS.MBI VARCHAR,
CASEDETAILS.MEMBER VARCHAR);
it works and I'm able to fetch the data from the table with the select query but I'm not able to update any rows nor able to insert new rows. It gives an error "Table is Read-Only"
But when in the above Phoenix create command I replace "view" with "table" i.e. I'm trying to create a table with same name in Phoenix; table creation is successful but select statement doesn't work.
So I have few questions here:
1) Why the view over existing Hbase table works but table doesn't?
2) Is there a way to update existing rows in HBase table using Phoenix SQL interface?
3) How important it is to maintain the order of column names and column names case when mapping an existing table in Phoenix?
Note: I have explored existing database for similar questions and reached to the point to realise that my view was working but not table. However, none of the questions were able to resolve my end problem which is to update existing rows of existing HBase table through Phoenix