2013年8月6日星期二

Solving the following table to build the hive hadoop mean?

CREATE TABLE hbase_orderqueue (key string, ntime int, nside int, nprice int, norders int, nabitems int, itemsdetail string)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ": key, a: 1, a: 2, a: 3, a: 4, a: 5, a: 6" ;)
TBLPROPERTIES ("hbase.table.name" = "orderqueue");
This table was created on the hive warehouse, or on the hbase in it? Not clear ah? ? ? ? ? Ask an expert to explain! !

insert data:
/ / Shenzhen
insert into table hbase_orderqueue select concat ('sz', securityid, tradetime, case when sendtime <100000 then concat ('0 ', sendtime) else cast (sendtime as string) end), sendtime, 66, lastpx, numorders_b1, noorders_b1, orderqty_b1 from szl2.tick;
insert into table hbase_orderqueue select concat ('sz', securityid, tradetime, case when sendtime <100000 then concat ('0 ', sendtime) else cast (sendtime as string) end), sendtime, 65, lastpx, numorders_s1, noorders_s1, orderqty_s1 from szl2.tick;
here if the above data into a table field is not one to one ah? ?

/ / Shanghai
insert into table hbase_orderqueue select concat (market, securityid, tradedate, case when sendtime <100000 then concat ('0 ', sendtime) else cast ( sendtime as string) end), sendtime, nside, nprice, norderitems, nabitems, nabvolume from shl2.orderqueue;

------ Solution ------------------------------------ --------
1, the data is present in HBASE

2, is one to one, HIVE can not directly insert random data into the table, the table must be poured through other HIVE.
HIVE data sheets are generally mapped data source for other media, such as HDFS FILE, HBASE, MYSQL, etc.

没有评论:

发表评论