Mapping an existing table requires the Hive EXTERNAL keyword, which is also
used in other places to access data stored in *unmanaged* Hive tables,
i.e., those that are not under Hive's control:

Add a comment <http://ofps.oreilly.com/titles/9781449396107/clients.html#>

hive> *CREATE EXTERNAL TABLE hbase_table_2(key int, value string)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf1:val")
TBLPROPERTIES("hbase.table.name" = "<existing-table-name>");*


Regards,
Abhishek
On Tue, Dec 13, 2011 at 12:56 AM, Aditya Kumar <adityakumar...@yahoo.com>wrote:

> no luck..
>
> here is the Error I am getting:
>
> hive>
>     > CREATE TABLE hbase_table_1(key int, event string)
>     > STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
>     > WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf1:val")
>     > TBLPROPERTIES ("hbase.table.name" = 'USER_DETAILS');
> FAILED: Error in metadata:
> MetaException(message:Table USER_DETAILS already exists within HBase; use
> CREATE EXTERNAL TABLE instead to register it in Hive.)
> FAILED: Execution Error, return code 1 from
> org.apache.hadoop.hive.ql.exec.DDLTask.
>
> I dont want to create a external table ..but to access the data from hbase
>
>
>
>
> ________________________________
> From: Abhishek Pratap Singh <manu.i...@gmail.com>
> To: Aditya Kumar <adityakumar...@yahoo.com>
> Cc: "user@hive.apache.org" <user@hive.apache.org>
> Sent: Monday, December 12, 2011 9:44 PM
> Subject: Re: Hive Basic question
>
>
> it will work, as you will provide the Serde properties related to HBase.
> Just create the hive table, map it with HBase table and try to access it.
>
>
> ~Abhishek
>
> On Tue, Dec 13, 2011 at 12:41 AM, Aditya Kumar <adityakumar...@yahoo.com>
> wrote:
>
>
> >Thanks Abhishek for the response.
> >I did see that link but that is telling more creating HIVE table and than
> check in HBAse.
> >my case is I have the data in tables in Hbase. i can view them in HBase.
> >but want to do access them from HIVE.
> >
> >btn I am new to Hadoop world.
> >
> >Can yoyu pl let me know if I am missing anything and how to proceed
> >
> >
> >
> >________________________________
> >From: Abhishek Pratap Singh <manu.i...@gmail.com>
> >To: user@hive.apache.org; Aditya Kumar <adityakumar...@yahoo.com>
> >Sent: Monday, December 12, 2011 9:32 PM
> >Subject: Re: Hive Basic question
> >
> >
> >
> >Here you go, check this link
> >
> >https://cwiki.apache.org/confluence/display/Hive/HBaseIntegration
> >
> >Regards,
> >Abhishek
> >
> >On Tue, Dec 13, 2011 at 12:30 AM, Aditya Kumar <adityakumar...@yahoo.com>
> wrote:
> >
> >Hi,
> >>I have a Hbase table that I am able to insert data and do scan.
> >>I want to have use HIVE,.
> >>
> >>I was able to install HIVE and login to Hive Console.
> >>Can you please tell me the way I can access the HBASE Table fgrom HIVE.
> >>I want to use HQL Commands on HBase table...
> >>
> >>please let me know how to do that .
> >>
> >>Thanks in Advance
> >>-Adi
> >>
> >
>

Reply via email to