# How to get a better performance to load ElasticSearch data into Hive?

**URL:** https://discuss.elastic.co/t/how-to-get-a-better-performance-to-load-elasticsearch-data-into-hive/262051
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [January 25, 2021, 3:40am UTC](https://discuss.elastic.co/t/how-to-get-a-better-performance-to-load-elasticsearch-data-into-hive/262051 "2021-01-25T03:40:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sean\_Han](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sean_han/32/82824_2.png) [@Sean\_Han](https://discuss.elastic.co/u/Sean_Han)
#### Post date: [January 25, 2021, 3:40am UTC](https://discuss.elastic.co/t/how-to-get-a-better-performance-to-load-elasticsearch-data-into-hive/262051/1 "2021-01-25T03:40:28Z")

</div>

We created the Hive external table using ElasticSearch StorageHandler as shown below:

```auto
CREATE EXTERNAL TABLE DEFAULT.ES_TEST (
  REG_DATE STRING
, STR1 STRING
, STR2 STRING
, STR3 STRING
, STR4 STRING
, STR5 STRING
)
ROW FORMAT SERDE 'org.elasticsearch.hadoop.hive.EsSerDe'
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES (
  'es.resource' = 'log-22-20210120'
, 'es.nodes' = '1.2.3.4'
, 'es.port' = '9201'
, 'es.mapping.date.rich' = 'false'
);

```

And then we tried to load the ES data into Hive managed table as like:

```auto
insert overwrite table elastic.es_log_tab partition(part_log_date)
select *
, current_timestamp()
, from_unixtime(unix_timestamp(reg_date), 'yyyyMMdd')
from DEFAULT.ES_TEST;

```

When the ES data for given date is volumed to about 65GB, it was approximated taken 10 hours or 1.1M rows per minute (670M rows in total).

In order to get a better loading performance for this case, are there any further recommendation or checkpoints? How about increasing the number of mappers? Currently, it is running with 16 mappers. Expecting to get it faster with more mappers?

Please share your thoughts and previous experience with me.

---

<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: [February 22, 2021, 3:40am UTC](https://discuss.elastic.co/t/how-to-get-a-better-performance-to-load-elasticsearch-data-into-hive/262051/2 "2021-02-22T03:40:31Z")

</div>

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