加载storage handler.org.apache.hadoop.hive.hbase.hbasestoragehandler时出错

31moq8wy  于 2021-06-10  发布在  Hbase
关注(0)|答案(1)|浏览(813)

我正在尝试通过squirrelsql查询hbase表。创建了一个配置单元外部表,如下所示

create external table tweets_hbase(key string, value string)
stored by 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
with serdeproperties ("hbase.columns.mapping" = ":key,data:tweet_text")
tblproperties ("hbase.table.name" = "tweets_hbase")

我可以通过命令行配置单元进行查询

hive> select * from tweets_hbase;
OK
20160725001730109       {"createdat":"25-Jul-2016 12:17:03","tweet_date":"2016-07-25","text":"私のランドールスゴビ:) \n#abyssrium\nhts:t.co/NcKtQi9lzm ht/t.co/WNgQIxLU05","user":"uw_kyaaaan","uniqueid":1469420239464,"searchtag":"Apple"}
20160725001730266       {"createdat":"25-Jul-2016 12:17:03","tweet_date":"2016-07-25","text":"2016年7月24日\n8422 Steps\n移動距離 6.485 km\n消費カロリー 467.6 kcal\n\n#M7POPOPO ht/t.co/eFathZXTHD","user":"matsuwichi","uniqueid":1469420239465,"searchtag":"Apple"}
20160725001730308       {"createdat":"25-Jul-2016 12:17:03","tweet_date":"2016-07-25","text":"RT @JBCrewdotcom: Don't forget to leave a nice review for #Coldwater after purchasing! \niTunes: t.co/p5YKRwPKNw\nGoogle Play: ht\u2026","user":"2016OLLGAndUGRL","uniqueid":1469420239466,"searchtag":"Apple"}

但是,当我尝试通过squirrelsql进行查询时,我在加载时遇到了一个错误。必要的jar已经添加到额外的类路径中。
hive-hbase-handler-1.1.0.jar
hbase-client-1.1.5.jar
hbase-common-1.1.5.jar
hbase-protocal-1.1.5.jar
hbase-server-1.1.5.jar
hive-jdbc-1.1.1-standalone.jar
请帮忙

java.sql.SQLException: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: Error in loading storage handler.org.apache.hadoop.hive.hbase.HBaseStorageHandler
at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:296)
at net.sourceforge.squirrel_sql.client.session.StatementWrapper.execute(StatementWrapper.java:165)
at net.sourceforge.squirrel_sql.client.session.SQLExecuterTask.processQuery(SQLExecuterTask.java:369)
at net.sourceforge.squirrel_sql.client.session.SQLExecuterTask.run(SQLExecuterTask.java:212)
at net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
at java.lang.Thread.run(Unknown Source)
dhxwm5r4

dhxwm5r41#

我自己解决的。以下是我必须做的:
升级hbase至1.2.2版本
启动thriftserver时,请使用以下jar和--jars选项启动
./start-thriftserver.sh--hiveconf hive.server2.thrift.port=10001--hiveconf hive.server2.thrift.bind.host=...--hiveconf spark.cores.max=2--masterspark://...:7077--name thriftserver--jars文件:///home/hadoop/software/apache-hive-1.2.1-bin/lib/hive-hbase-handler-1.2.1.jar,文件:///home/hadoop/software/hbase-1.2.2/lib/hbase-common-1.2.2.jar,文件:///home/hadoop/software/hbase-1.2.2/lib/hbase-protocol-1.2.2.jar,文件:///home/hadoop/software/hbase-1.2.2/lib/hbase-client-1.2.jar,文件:///home/hadoop/software/hbase-1.2.2/lib/guava-12.0.1.jar,文件:///home/hadoop/software/hbase-1.2.2/lib/hbase-server-1.2.2.jar,文件:///home/hadoop/software/hbase-1.2.2/lib/htrace-core-3.1.0-incubating.jar,文件:///home/hadoop/software/hbase-1.2.2/lib/metrics-core-2.2.0.jar

相关问题