# Write into ES using Hive uses only one reducer

**URL:** https://discuss.elastic.co/t/write-into-es-using-hive-uses-only-one-reducer/121998
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [March 1, 2018, 8:45am UTC](https://discuss.elastic.co/t/write-into-es-using-hive-uses-only-one-reducer/121998 "2018-03-01T08:45:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fede](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fede/32/126283_2.png) [@fede](https://discuss.elastic.co/u/fede)
#### Post date: [March 1, 2018, 8:45am UTC](https://discuss.elastic.co/t/write-into-es-using-hive-uses-only-one-reducer/121998/1 "2018-03-01T08:45:46Z")

</div>

Hi, I've testing the ES-hive library (elasticsearch-hadoop-hive-5.6.4.jar to match our cluster version) and I always get 1 reducer, is there any way to force more than 1 reducer, I had the intention of using hive to load half a billion of records into ES from a HDFS.  
My query looks like:  
set mapred.reduce.tasks=50;  
set hive.exec.reducers.max=50;  
CREATE EXTERNAL TABLE es\_table ( 200 columns here)  
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'  
TBLPROPERTIES(  
'es.nodes'= 'a list of my nodes (I know I need only one!)',  
'es.resource' = 'occurrence\_es/occurrence',  
'es.index.auto.create' = 'false',  
'es.nodes.wan.only' = 'false',  
'es.mapping.id' = 'id',  
'es.batch.size.entries'= '10000');

and then  
INSERT INTO TABLE es\_table  
SELECT .... FROM my\_row\_format\_table;

Hadoop versions:  
CDH 5.12.1-1.cdh5.12.1.p0.3  
Hive 1.1.0-cdh5.12.1

I know that I probably should be doing this on Spark, Beam, MR, etc; I'm just evaluating options that involve less maintenance of source code, libs, etc.

Thanks.

---

<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: [March 17, 2018, 12:03am UTC](https://discuss.elastic.co/t/write-into-es-using-hive-uses-only-one-reducer/121998/2 "2018-03-17T00:03:16Z")

</div>

This could be an issue with Hive, but could more likely be an issue with what query you are running in the `SELECT .... FROM my_row_format_table;` statement. Certain hive functions like distinct require the planner to only schedule one reducer.

---

<div class="post-metadata">

### Author: ![cssturkiye](https://avatars.discourse-cdn.com/v4/letter/c/e19adc/32.png) [@cssturkiye](https://discuss.elastic.co/u/cssturkiye)
#### Post date: [March 24, 2018, 1:32pm UTC](https://discuss.elastic.co/t/write-into-es-using-hive-uses-only-one-reducer/121998/3 "2018-03-24T13:32:44Z")

</div>

thanks for sharing.

[ankara temizlik şirketleri](https://www.cssturkiye.com/)

---

<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: [April 21, 2018, 1:32pm UTC](https://discuss.elastic.co/t/write-into-es-using-hive-uses-only-one-reducer/121998/4 "2018-04-21T13:32:47Z")

</div>

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