Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Encountering error when creating Hive table integrated with HBase

Highlighted

Encountering error when creating Hive table integrated with HBase

New Contributor

I wanted to create a table in Hive but throwing error.

please check the attached image.

The query snippet is given below

CREATE TABLE bhaskar.hbase_gprs
(daykey string,
chrgd_amt INT, 
chrgd_amt_lcl INT, 
chrgd_amt_rpt INT,
tot_drtn INT, 
tot_bytes_trnsfrd_outbnd INT, 
tot_bytes_trnsfrd_inbnd INT, 
tot_session INT)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping"=":daykey,
chrgd:chrgd_amt,
chrgd:chrgd_amt_lcl,
chrgd:chrgd_amt_rpt,
tot_drtn:tot_drtn,
bytes_trnsfrd:tot_bytes_trnsfrd_outbnd,
bytes_trnsfrd:tot_bytes_trnsfrd_inbnd,
tot_session:tot_session")
TBLPROPERTIES ("hbase.table.name"="dwd_data_usg_day","hbase.mapred.output.outputtable"="dwd_data_usg_day");

40393-capture.jpg

1 REPLY 1

Re: Encountering error when creating Hive table integrated with HBase

Hi @Bhaskar Das,

The problem is that you are not explicitly providing a :key column which makes it 9 columns instead of 8.

Read more about Column Mapping here.

Thanks,

Aditya