Support Questions

Find answers, ask questions, and share your expertise

How to create external table on hbase with location

New Contributor

While creating external table with location i am getting error

I tried with location option getting an error

CREATE external TABLE user_db.test_hbase( col_1 String, col_2 String )
CLUSTERED BY (col_1) INTO 6 BUCKETS STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,test_hbase:col_2") LOCATION '/user/production/' TBLPROPERTIES("hbase.table.name" = "user_db:test_hbase");

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:LOCATION may not be specified for HBase.)

2 REPLIES 2

Super Guru

@Rohit Sinha

I don't think we can specify location and bucketing in Hive-Hbase integration.

Try with this create table statement:

CREATE external TABLE user_db.test_hbase( col_1 String, col_2 String ) 
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' 
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,test_hbase:col_2")  
TBLPROPERTIES("hbase.table.name" = "user_db:test_hbase");


New Contributor

Any idea to get the location, Itention of location is to copy the data from one cluser to another clusert. So i would need the hdfs location