Configuring Hive with Hbase

大兔子大兔子 提交于 2019-12-24 02:00:22

问题


I need to execute queries on HBase using hive. I have downloaded the HBase and hive my HMaster is running fine; I need to know what configuration changes I need to do for hive to work with HBase as the back end database. Any link tutorial will be appreciated. Thanks in advance.


回答1:


The apache Hive wiki explains it nicely https://cwiki.apache.org/confluence/display/Hive/HBaseIntegration

To create an HBase table that is managed from hive try something like

CREATE TABLE hive_managed(key string, value1 string, value2 int)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,columnFamilyName:val1,columnFamilyName:val2")
TBLPROPERTIES ("hbase.table.name" = "hivemanaged");

*edited following comment



来源:https://stackoverflow.com/questions/8223230/configuring-hive-with-hbase

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!