Hi Ravi - Thanks a lot for your reply. Yes it works! I changed the query to
this and it completed successfully.
create external table if not exists hbasepersontable (id int, firstname STRING,
lastname STRING )
stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
with serdeproperties ('hbase.columns.mapping' = ':key, 0:FIRSTNAME, 0:LASTNAME')
tblproperties ('hbase.table.name' = 'PERSON');
it’s getting more fun now :).
William.
From: Ravi Kiran [mailto:[email protected]]
Sent: Sunday, March 15, 2015 6:09 AM
To: [email protected]
Subject: Re: Using Hive on Phoenix Tables
Hi William,
Phoenix tries to create tables by upper casing them and thus I believe the
table name that would have been created is PERSON and hence it's not matching
Person. Can you please give it a try with giving the table name in upper case.
Regards
Ravi
On Sun, Mar 15, 2015 at 1:03 AM, William Li <[email protected]
<mailto:[email protected]> > wrote:
Hi – I’m new to Phoenix and love everything so far. Have installed a cluster
and developing some sample codes on it. I have the following question:
Can I use Hive to run queries on tables created by Phoenix? I used Phoenix to
create a new table name Person and inserted several rows through Java API. It
worked great. However, when trying to do this on Hive shell:
create external table if not exists hbasepersontable (id int, firstname STRING,
lastname STRING )
stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
with serdeproperties ('hbase.columns.mapping' = ':key, firstname:firstname,
lastname:lastname')
tblproperties ('hbase.table.name <http://hbase.table.name> ' = 'Person');
It threw an exception and said the table ‘Person’ does not exists. I assume I
can do that because these tables are created on Hbase. Please help.
Thanks,
William.