# Insert data from hive to elasticsearch

**URL:** <https://discuss.elastic.co/t/insert-data-from-hive-to-elasticsearch/1538>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [May 29, 2015, 5:45am UTC](https://discuss.elastic.co/t/insert-data-from-hive-to-elasticsearch/1538 "2015-05-29T05:45:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gzvince](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@gzvince](https://discuss.elastic.co/u/gzvince)\
**Post date:** [May 29, 2015, 5:45am UTC](https://discuss.elastic.co/t/insert-data-from-hive-to-elasticsearch/1538/1 "2015-05-29T05:45:56Z")

</div>

I have CDH 5.3.2 and Elasticsearch 1.5.2.  
Then I have used Elasticsearch-hadoop 2.0.2 to connected them.

I have created a table in Hive for es:

```
CREATE EXTERNAL TABLE user (id INT, name STRING)    
ROW FORMAT SERDE 'org.elasticsearch.hadoop.hive.EsSerDe'
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'  
TBLPROPERTIES('es.nodes' = '10.88.1.2', 'es.resource' = 'radiott/artiststt','es.index.auto.create' = 'true');

```

And then I insert some data in the table:

```
INSERT OVERWRITE TABLE user SELECT s.id, s.username FROM test.eslog s limit 10;

```

When I try to insert the data. I get the following message:

```
Starting Job = job_1428991871637_0126, Tracking URL = http://rl-hadoop1:8088/proxy/application_1428991871637_0126/
Kill Command = /opt/cloudera/parcels/CDH-5.3.2-1.cdh5.3.2.p0.10/lib/hadoop/bin/hadoop job -kill job_1428991871637_0126
Hadoop job information for Stage-0: number of mappers: 0; number of reducers: 0
2015-05-29 11:21:21,098 Stage-0 map = 0%, reduce = 0%
Ended Job = job_1428991871637_0126 with errors
Error during job, obtaining debugging information...
FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
MapReduce Jobs Launched: 
Stage-Stage-0: HDFS Read: 0 HDFS Write: 0 FAIL
Total MapReduce CPU Time Spent: 0 msec

```

When I dig deeper in Hadoop logs I get the following error (warn):

```
PriviledgedActionException as:admin (auth:PROXY) via mapred (auth:SIMPLE) cause:java.io.FileNotFoundException: File does not exist: /user/admin/.staging/job_1428991871637_0124/job_1428991871637_0124.summary at org.apache.hadoop.hdfs.server.namenode.INodeFile.valueOf(INodeFile.java:65) at org.apache.hadoop.hdfs.server.namenode.INodeFile.valueOf(INodeFile.java:55) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsUpdateTimes(FSNamesystem.java:1879) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocationsInt(FSNamesystem.java:1820) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocations(FSNamesystem.java:1800) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getBlockLocations(FSNamesystem.java:1772) at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.getBlockLocations(NameNodeRpcServer.java:527) at org.apache.hadoop.hdfs.server.namenode.AuthorizationProviderProxyClientProtocol.getBlockLocations(AuthorizationProviderProxyClientProtocol.java:85) at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.getBlockLocations(ClientNamenodeProtocolServerSideTranslatorPB.java:356) at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java) at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:587) at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1026) at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2013) at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:2009) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1642) at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2007)

```

What am I missing? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![gzvince](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@gzvince](https://discuss.elastic.co/u/gzvince)\
**Post date:** [June 1, 2015, 6:19am UTC](https://discuss.elastic.co/t/insert-data-from-hive-to-elasticsearch/1538/2 "2015-06-01T06:19:24Z")

</div>

I'm a hadoop newer. Please help.

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [June 4, 2015, 6:46pm UTC](https://discuss.elastic.co/t/insert-data-from-hive-to-elasticsearch/1538/3 "2015-06-04T18:46:38Z")

</div>

Looks like an error with your Hadoop/CDH install - maybe some configuration files are missing or potentially there are some user credentials problems?

Also note that you don't have to specify the `SerDe` - what makes you do that? The docs don't specify it and neither the readme.  
Additionally, you can try the `2.1.0.Beta4` build - see the reference docs [here](https://www.elastic.co/guide/en/elasticsearch/hadoop/master/install.html)

---

<div class="post-metadata">

**Author:** ![gzvince](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@gzvince](https://discuss.elastic.co/u/gzvince)\
**Post date:** [June 10, 2015, 7:30am UTC](https://discuss.elastic.co/t/insert-data-from-hive-to-elasticsearch/1538/4 "2015-06-10T07:30:28Z")

</div>

I try the 2.1.0.Beta4 build and it works very well. Thank you very much 😄

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [June 10, 2015, 7:46am UTC](https://discuss.elastic.co/t/insert-data-from-hive-to-elasticsearch/1538/5 "2015-06-10T07:46:15Z")

</div>

Great! Glad to hear it.

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [June 25, 2015, 12:10am UTC](https://discuss.elastic.co/t/insert-data-from-hive-to-elasticsearch/1538/6 "2015-06-25T00:10:35Z")

</div>

This is a test replyThis is a test replyThis is a test replyThis is a  
test replyThis is a test replyThis is a test reply

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:28pm UTC](https://discuss.elastic.co/t/insert-data-from-hive-to-elasticsearch/1538/7 "2017-07-06T13:28:12Z")

</div>


