hive 语法

 hive访问已经存在的hbase

CREATE EXTERNAL TABLE hbase_hive_names(hbid INT, id INT, fn STRING, ln STRING, age INT) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,id:id,name:fn,name:ln,age:age") TBLPROPERTIES("hbase.table.name" = "hbase_2_hive_names");

 :key --- rowkey 其他字段一一对应

启动 hive

./hive --auxpath /opt/modules/hive/hive-0.9.0/lib/hive-hbase-handler-0.9.0.jar,/opt/modules/hive/hive-0.9.0/lib/hbase-0.92.0.jar,/opt/modules/hive/hive-0.9.0/lib/zookeeper-3.4.3.jar -hiveconf hbase.master=master:60000
./hive --service hiveserver

 

你可能感兴趣的:(hive)