Hive corresponds to HBase data type
When the Double,int type in hbase is stored in byte, it must be garbled to remove it with a string.
This problem is also encountered when HIVD and HBase are integrated: The practice is:#b
1. Add #b
CREATE EXTERNAL TABLE hivebig (key string,cust_name string,phone_num Int,brd_work_flux Double)
STORED by ' Org.apache.hadoop.hive.hbase.HBaseStorageHandler '
With Serdeproperties ("hbase.columns.mapping" = ": Key,bd:cust_name,bd:phone_num#b,bd:brd_work_flux#b")
Tblproperties ("hbase.table.name" = "bigtable2");
2. When #b is not added, the hive shell reads out garbled
CREATE EXTERNAL TABLE hivebig (key string,cust_name string,phone_num Int,brd_work_flux Double)
STORED by ' Org.apache.hadoop.hive.hbase.HBaseStorageHandler '
With Serdeproperties ("hbase.columns.mapping" = ": Key,bd:cust_name,Bd:phone_num,Bd:brd_work_flux")
Tblproperties ("hbase.table.name" = "bigtable2");
SELECT * from Hivebig;
SELECT * from Hivebig where phone_num > 1;
SELECT * from Hivebig where Brd_work_flux > 1555;
cf:val#s in the#sis a representation of typestring, Cf:foo does not have a configuration type, it is configured with Hbase.table.default.storage.type, #b为binary
Hive corresponds to HBase data type