CREATE EXTERNAL TABLE default.user_regionalization(key string,uid string,followersCount int)STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping"=":key,fn:uid,fn:followersCount")TBLPROPERTIES("hbase.table.name" = "crawl:user_regionalization");
注释 default.user_regionalization //命名空间.hive表名 STORED BY ‘org.apache.hadoop.hive.hbase.HBaseStorageHandler’ //类似引入hbase依赖 TBLPROPERTIES(“hbase.table.name” = “crawl:user_regionalization”); //hbase对应命名空间.表
注意 两张表的字段需要一一对应,类型可以在hive随意设置