使用HIVE SQL操作分布式集群HBASE:
1,在Hive中创建HBase识别的表
hive>
>
> CREATE EXTERNAL TABLE hbase_hive_.....tion(rowkey string, info map<STRING,STRING>)
> STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
> WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,info:")
> TBLPROPERTIES ("hbase.table.name" = "db_r......._operation");
OK
Time taken: 0.959 seconds
2,hive连接Hbase,查询数据:
root@master:~# jps
3808 Jps
3075 ResourceManager
3715 HRegionServer
3395 QuorumPeerMain
2932 SecondaryNameNode
3543 HMaster
2715 NameNode
root@master:~# hive
18/06/14 10:15:34 WARN conf.HiveConf: HiveConf of name hive.server2.http.endpoint does not exist
Logging initialized using configuration in jar:file:/usr/local/apache-hive-1.2.1/lib/hive-common-1.2.1.jar!/hive-