hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Omer, Farah" <fo...@microstrategy.com>
Subject Load data into hbase
Date Mon, 18 May 2015 19:33:05 GMT
How should I go about creating and loading a bunch of lookup tables on HBASE? These are the
typical RDBMS kind of data - where the data is row-oriented. All the data is coming from a
flat file that's again row-oriented.
How best can I load this data into HBASE? I first created the table in Hive, mapped to the
HBase table:



CREATE TABLE CITY_CTR_SLS (
id string,
CUST_CITY_ID INT,
CALL_CTR_ID INT,
TOT_DOLLAR_SALES FLOAT,
TOT_UNIT_SALES FLOAT,
TOT_COST FLOAT)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES (
  "hbase.columns.mapping" =
  ":key,ints:CUST_CITY_ID,ints:CALL_CTR_ID,floats:TOT_DOLLAR_SALES,floats:TOT_UNIT_SALES,floats:TOT_COST"
  )
TBLPROPERTIES("hbase.table.name" = "hbase_CITY_CTR_SLS1");



When I run the following command to load data into the hive table, I get an error about mismatched
columns(because of the additional ID column for hbase that's needed:



[ash-r101-14l.mstrprime.com:21000] > INSERT INTO CITY_CTR_SLS select * from wh2.CITY_CTR_SLS;
...................................(wh2.city_ctr_sls already exists)

Query: insert INTO CITY_CTR_SLS select * from wh2.CITY_CTR_SLS

ERROR: AnalysisException: Target table 'hbase_temp.city_ctr_sls' has more columns (6) than
the SELECT / VALUES clause returns (5)

[ash-r101-14l.mstrprime.com:21000] >

Any pointers? Thanks.
Farah



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message