ES-hive query error--EsHiveSplit not found

(Gzvince) #1

Version of ES: 2.4.1
version of Es-Hadoop jar: 2.4.0
CDH version: 5.8.3

Hello All:

I am using Elasticsearch-hadoop jar to connect ES and hive. Following my create table SQL:

CREATE EXTERNAL TABLE weather_observe_t (
	errorcode	string,
	time	string)
ROW FORMAT SERDE 'org.elasticsearch.hadoop.hive.EsSerDe'
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
'es.nodes' = '',
'es.port' =  '9200',
'es.resource' = 'logstash-weather-observe/weatherlog',
'es.query' = '?q=*',
'' = 'false',
'es.mapping.names' = 'errorcode:errorCode');

I excuted select SQL:
select * from weather_observe_t;
It's done and got the result.

Then I excuted another SQL:
select * from weather_observe_t order by time desc limit 10;

But I got the error:
Error: Cannot create an instance of InputSplit class = org.elasticsearch.hadoop.hive.EsHiveInputFormat$EsHiveSplit:Class org.elasticsearch.hadoop.hive.EsHiveInputFormat$EsHiveSplit not found
_ at$HiveInputSplit.readFields(
_ at$WritableDeserializer.deserialize(
_ at$WritableDeserializer.deserialize(
_ at org.apache.hadoop.mapred.MapTask.getSplitDetails(
_ at org.apache.hadoop.mapred.MapTask.runOldMapper(
_ at
_ at org.apache.hadoop.mapred.YarnChild$
_ at Method)
_ at
_ at
_ at org.apache.hadoop.mapred.YarnChild.main(
_Caused by: java.lang.ClassNotFoundException: Class org.elasticsearch.hadoop.hive.EsHiveInputFormat$EsHiveSplit not found
_ at org.apache.hadoop.conf.Configuration.getClassByName(
_ at$HiveInputSplit.readFields(
_ ... 10 more

Any help is greatly appreciated.

(James Baiera) #2

Is the ES-Hadoop jar correctly distributed to the cluster running Hive? Normally Hive is able to perform the basic select * queries in the local process as it's just reading the data as is from the source, but any further operations like grouping or sorting needs to be handled by the distributed portion of Hive. In this case the most likely cause is that the second query is trying to submit a job and the ES-Hadoop jar is not available on the job workers' classpaths.

(Gzvince) #3

I make a mistake before.

I add the elasticsearch-hadoop-2.4.0 in the hive lib. But I forgot there is a elasticsearch-hadoop-2.3.2 in it. Then I remove 2.3.2 jar lib directly.

I think hive could be use the old 2.3.2 jar lib but they couldn't found that. How can I assign the 2.4.0 jar lib in hive?

(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.