Impala与HBase整合
- impala可以通过Hive外部表的方式和Hbase进行整合
-步骤一:创建HBASE表,添加数据
create 'test_info','info';
put 'test_info','1','info:name','similarFish';
put 'test_info','2','info:name','fish';
-步骤二:创建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"="row_key:key,info:name")
tblproperties("hbase.table.name"="test_info")
-步骤三:刷新impala表 (hive不需要执行)
invalidate metadata
注:本质是hive元数据库建立一张表去映射HBASE数据库的表的元数据,这样impala在和hive共用元数据库时也能读取到这张表,以hive作为跳板去访问hbase