# Hive read es data slow

**URL:** https://discuss.elastic.co/t/hive-read-es-data-slow/208670
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [November 20, 2019, 10:07am UTC](https://discuss.elastic.co/t/hive-read-es-data-slow/208670 "2019-11-20T10:07:28Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![yousanghz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yousanghz/32/98666_2.png) [@yousanghz](https://discuss.elastic.co/u/yousanghz)
#### Post date: [November 20, 2019, 10:07am UTC](https://discuss.elastic.co/t/hive-read-es-data-slow/208670/1 "2019-11-20T10:07:28Z")

</div>

hive version 1.2.1  
es version 5.5.0  
hadoop-elasticsearch-5.5.0.jar

es.index: data\_monthly 10 shard

this is hsql

CREATE EXTERNAL TABLE es\_test5(  
id string,  
uid string,  
wb\_name string,  
platform string,  
comment\_count int,  
fetch\_time timestamp,  
play\_count int,  
favorite\_count int,  
repost\_count int,  
monthly\_net\_inc\_favorite\_count int ,  
monthly\_net\_inc\_play\_count int,  
monthly\_net\_inc\_comment\_count int,  
release\_time timestamp  
)  
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'  
TBLPROPERTIES(  
'es.nodes' = '192.168.17.111, 192.168.17.121',  
'es.index.auto.create' = 'false',  
'es.resource' = 'data\_monthly',  
'es.read.metadata' = 'true',  
'es.mapping.names' = 'id:\_metadata.\_id, uid:UID');

read data from es into hive ,

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/f/9fb74cb3f4098affa7c84161e521b68b117fc19b.png)

why 10 shard but 2 map ?  
why slow

please help me , Thank

---

<div class="post-metadata">

### Author: ![yousanghz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yousanghz/32/98666_2.png) [@yousanghz](https://discuss.elastic.co/u/yousanghz)
#### Post date: [November 21, 2019, 5:40am UTC](https://discuss.elastic.co/t/hive-read-es-data-slow/208670/2 "2019-11-21T05:40:11Z")

</div>

Please give me some advice.

---

<div class="post-metadata">

### Author: ![rameshkr1994](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rameshkr1994/32/59029_2.png) [@rameshkr1994](https://discuss.elastic.co/u/rameshkr1994)
#### Post date: [November 21, 2019, 1:38pm UTC](https://discuss.elastic.co/t/hive-read-es-data-slow/208670/3 "2019-11-21T13:38:07Z")

</div>

Hi @yousanghz.

is your data locality is ES?

if you are using data locality as ES then it will take more time because of network bandwidth !

its better to use DSL query for searching ES data!

Thanks  
HadoopHelp

---

<div class="post-metadata">

### Author: ![yousanghz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yousanghz/32/98666_2.png) [@yousanghz](https://discuss.elastic.co/u/yousanghz)
#### Post date: [November 22, 2019, 1:42am UTC](https://discuss.elastic.co/t/hive-read-es-data-slow/208670/5 "2019-11-22T01:42:26Z")

</div>

@rameshkr1994  
Thank you for your reply, I am very happy to receive a reply.

## Please forgive me for my bad English.

My data is indeed stored in ES， but why 10 shard == 2 map ？

i try to use 20 shard index , but start up 2 map

I saw the official document writes ' In short, roughly speaking more input splits means more tasks that can read at the same time, different parts of the source. More shards means more _buckets_ from which to read an index content (at the same time). '.

Did I understand it right?

Thank you again!

---

<div class="post-metadata">

### Author: ![rameshkr1994](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rameshkr1994/32/59029_2.png) [@rameshkr1994](https://discuss.elastic.co/u/rameshkr1994)
#### Post date: [November 22, 2019, 7:51am UTC](https://discuss.elastic.co/t/hive-read-es-data-slow/208670/6 "2019-11-22T07:51:17Z")

</div>

Hi @yousanghz.

Thank you !

as per your reply : -

`you :split means more task:- but me:split and shards are same concept in ES.`

`you: More shards means more buckets but me : buckets concept is totally diff with shards.`  
`you:i try to use 20 shard index , but start up 2 map but me:what is map here your are getting number of map 2 while running the query from Hive?`

`your ES Cluster decides the number of shards and number of cluster nodes.`

`finally : you are applying the concept of Hadoop with ES.`

correct me if i am wrong !!!

Thanks  
HadoopHelp

---

<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: [December 20, 2019, 7:58am UTC](https://discuss.elastic.co/t/hive-read-es-data-slow/208670/7 "2019-12-20T07:58:30Z")

</div>

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