Impala可以通过Hive外部表方式和HBase进行整合,步骤如下:
• 步骤1:创建hbase 表,向表中添加数据
create 'test_info', 'info' put 'test_info','1','info:name','zhangsan’ put 'test_info','2','info:name','lisi'
• 步骤2:创建hive表
CREATE EXTERNAL TABLE test_info(key string,name string ) ROW FORMAT SERDE 'org.apache.hadoop.hive.hbase.HBaseSerDe' STORED by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping"=":key,info:name") TBLPROPERTIES ("hbase.table.name" = "test_info");
• 步骤3:刷新Impala表
invalidate metadata