hivesever2无法从elasticsearch hadoop加载esstoragehandler类

hwamh0ep  于 2021-05-30  发布在  Hadoop
关注(0)|答案(1)|浏览(623)

我有这个配置 hive-site.xml ```

hive.aux.jars.path
/path/to/elasticsearch-hadoop-2.0.1.jar

当我将数据Map到hivecli中的elasticsearch时,它可以通过以下代码正常工作:

CREATE EXTERNAL TABLE artists (...)
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES('es.resource' = 'radio/artists',
'es.index.auto.create' = 'false')

但当我在HiveJava客户机(我启动了hiveserver2)中使用它时,它会引发以下异常:

FAILED: Execution Error, return code 1
from org.apache.hadoop.hive.ql.exec.DDLTask.
org.apache.hadoop.hive.ql.metadata.HiveException:
Error in loading storage handler.org.elasticsearch.hadoop.hive.EsStorageHandler

s2j5cfk0

s2j5cfk01#

在$hive\u home/lib文件夹中添加elasticsearch-hadoop-2.0.1.jar文件。
编辑您的查询-创建外部表艺术家(…)行格式serde'org.elasticsearch.hadoop.hive.essorde'存储在'org.elasticsearch.hadoop.hive.esstoragehandler'tblproperties('s.resource'='radio/artists','es.index.auto.create'='false');
希望能有帮助。。

相关问题