老师您好,我创建了一张hive到hbase映射表
CREATE TABLE xsyq_accuracy_hbase(
key string,
pday int,
enterprisename string,
parameter string,
parametertype string,
processname string,
accuracy double
)
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler’
WITH SERDEPROPERTIES (“hbase.columns.mapping” = “:key,cf1:pday,cf1:enterprisename,cf1:parameter,cf1:parametertype,cf1:processname,cf1:accuracy”)
TBLPROPERTIES (“hbase.table.name” = “xsyq_accuracy_hbase”, “hbase.mapred.output.outputtable” = “xsyq_accuracy_hbase”);
在hive里通过sql语句可以通过insert into插入数据到hbase,但是用spark sql插入时报错:
hbase-protocol-2.1.1.jar
hbase-client-2.1.1.jar
hbase-common-2.1.1.jar
hbase-server-2.1.1.jar
metrics-core-3.2.1.jar
hive-hbase-handler-2.3.4.jar
htrace-core-3.1.0-incubating.jar
hbase-annotations-2.1.1.jar
hbase-hadoop2-compat-2.1.1.jar
hbase-hadoop-compat-2.1.1.jar
以上jar包已经导入了spark的jars文件夹内