# java.net.ConnectException when trying to overwrite a table in Hive?

**URL:** <https://discuss.elastic.co/t/java-net-connectexception-when-trying-to-overwrite-a-table-in-hive/90952>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [June 27, 2017, 11:46am UTC](https://discuss.elastic.co/t/java-net-connectexception-when-trying-to-overwrite-a-table-in-hive/90952 "2017-06-27T11:46:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kulasangar\_Gowrisang](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@Kulasangar\_Gowrisang](https://discuss.elastic.co/u/Kulasangar_Gowrisang)\
**Post date:** [June 27, 2017, 11:46am UTC](https://discuss.elastic.co/t/java-net-connectexception-when-trying-to-overwrite-a-table-in-hive/90952/1 "2017-06-27T11:46:58Z")

</div>

I'm already having a table( **test** ) in hive, with a single column ( **logtype** ) which has around 5 rows.

And I created another table( **hive\_to\_elastic** ) with ES properties as such:

```
CREATE EXTERNAL TABLE hive_to_elastic(logtype string)
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES('es.resource'='my_index/my_type','es.nodes'='10.2.2.47','es.port'='9200');

```

Now I'm simply trying to copy the data from **test** to **hive\_to\_elastic** by executing the below query:

`INSERT OVERWRITE TABLE hive_to_elastic SELECT * FROM test;`

But what I can see is this:

[![enter image description here](https://i.stack.imgur.com/MU6dJ.png)](https://i.stack.imgur.com/MU6dJ.png)

And it's frozen after that point. I couldn't see the no of docs count increasing in my ES index.After a long time since I've started executed the query, I get this exception:

[![enter image description here](https://i.stack.imgur.com/tqPey.png)](https://i.stack.imgur.com/tqPey.png)

Where am I going wrong? Any help could be appreciated.

---

<div class="post-metadata">

**Author:** ![james.baiera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james.baiera/32/10209_2.png) [@james.baiera](https://discuss.elastic.co/u/james.baiera)\
**Post date:** [June 27, 2017, 9:50pm UTC](https://discuss.elastic.co/t/java-net-connectexception-when-trying-to-overwrite-a-table-in-hive/90952/2 "2017-06-27T21:50:53Z")

</div>

It seems that hive cannot reach hadoop to launch the job. The stacktrace seems to highlight that the connection is being refused in the hadoop rpc layer.

---

<div class="post-metadata">

**Author:** ![Kulasangar\_Gowrisang](https://avatars.discourse-cdn.com/v4/letter/k/ce73a5/32.png) [@Kulasangar\_Gowrisang](https://discuss.elastic.co/u/Kulasangar_Gowrisang)\
**Post date:** [June 28, 2017, 4:36am UTC](https://discuss.elastic.co/t/java-net-connectexception-when-trying-to-overwrite-a-table-in-hive/90952/3 "2017-06-28T04:36:15Z")

</div>

@james.baiera Thank you so much for the reply.[quote="james.baiera, post:2, topic:90952"]  
It seems that hive cannot reach hadoop to launch the job  
[/quote]

What could be the initiatives I could take, in order to resolve this? Could this be due to the network restrictions?

Do I have to add anything within the hadoop or hive configurations? I could provide the configs if needed.

Thanks.

---

<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 26, 2017, 4:36am UTC](https://discuss.elastic.co/t/java-net-connectexception-when-trying-to-overwrite-a-table-in-hive/90952/4 "2017-07-26T04:36:20Z")

</div>

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