Hadoop env - 2.6.0-cdh5.11.0
Elastic - 2.4.4
Hive - version 1.1.0-cdh5.11.0
So, i created a basic external table using the query :-
CREATE EXTERNAL TABLE testESHIVE (name STRING)
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES('es.nodes' = 'xxxx', 'es.port' ='9220', 'es.resource' = 'hivedemo/sample', 'es.index.auto.create' = 'true');
I also created an index on elastic side with the name hivedemo.
Now, when i am trying to execute " INSERT OVERWRITE TABLE testESHIVE select * from demo " it throws the mentioned error(return code 2).
However, when i add any record into the index using sense, i am able to view the same through select query in Hive, which indicates that both elastic and hive is linked.
The issue is faced only when inserting from Hive side.
FULL STACK TRACE :-
INFO : Compiling command(queryId=hive_20171011042121_3882c424-79a5-466a-9249-aa0d5186e94a): insert overwrite table testeshive select * from demo
INFO : Semantic Analysis Completed
INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:demo.name, type:string, comment:null)], properties:null)
INFO : Completed compiling command(queryId=hive_20171011042121_3882c424-79a5-466a-9249-aa0d5186e94a); Time taken: 0.132 seconds
INFO : Executing command(queryId=hive_20171011042121_3882c424-79a5-466a-9249-aa0d5186e94a): insert overwrite table testeshive select * from demo
INFO : Query ID = hive_20171011042121_3882c424-79a5-466a-9249-aa0d5186e94a
INFO : Total jobs = 1
INFO : Launching Job 1 out of 1
INFO : Starting task [Stage-0:MAPRED] in serial mode
INFO : Number of reduce tasks is set to 0 since there's no reduce operator
INFO : number of splits:1
INFO : Submitting tokens for job: job_1507691246139_0043
INFO : Kind: kms-dt, Service: 10.63.13.16:16000, Ident: (kms-dt owner=hive, renewer=yarn, realUser=, issueDate=1507710110641, maxDate=1508314910641, sequenceNumber=31716, masterKeyId=307)
INFO : Kind: HDFS_DELEGATION_TOKEN, Service: ha-hdfs:nameservice1, Ident: (token for hive: HDFS_DELEGATION_TOKEN owner=hive/r00f16n0c.bnymellon.net@CDHDEV.BNYMELLON.NET, renewer=yarn, realUser=, issueDate=1507710110610, maxDate=1508314910610, sequenceNumber=32101, masterKeyId=378)
INFO : The url to track the job: http://r00f16n0c.bnymellon.net:8088/proxy/application_1507691246139_0043/
INFO : Starting Job = job_1507691246139_0043, Tracking URL = http://r00f16n0c.bnymellon.net:8088/proxy/application_1507691246139_0043/
INFO : Kill Command = /opt/cloudera/parcels/CDH-5.11.0-1.cdh5.11.0.p0.34/lib/hadoop/bin/hadoop job -kill job_1507691246139_0043
INFO : Hadoop job information for Stage-0: number of mappers: 1; number of reducers: 0
INFO : 2017-10-11 04:21:56,674 Stage-0 map = 0%, reduce = 0%
INFO : 2017-10-11 04:22:15,229 Stage-0 map = 100%, reduce = 0%
ERROR : Ended Job = job_1507691246139_0043 with errors
ERROR : FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
INFO : MapReduce Jobs Launched:
INFO : Stage-Stage-0: Map: 1 HDFS Read: 0 HDFS Write: 0 FAIL
INFO : Total MapReduce CPU Time Spent: 0 msec
INFO : Completed executing command(queryId=hive_20171011042121_3882c424-79a5-466a-9249-aa0d5186e94a); Time taken: 26.977 seconds
Error: Error while processing statement: FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask (state=08S01,code=2)
Please help me out so as to rectify this issue asap.
Thanks