# Elastic Search -Hive mapping

**URL:** https://discuss.elastic.co/t/elastic-search-hive-mapping/16903
**Category:** Elasticsearch
**Created:** [April 9, 2014, 6:31pm UTC](https://discuss.elastic.co/t/elastic-search-hive-mapping/16903 "2014-04-09T18:31:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![P\_lva](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@P\_lva](https://discuss.elastic.co/u/P_lva)
#### Post date: [April 9, 2014, 6:31pm UTC](https://discuss.elastic.co/t/elastic-search-hive-mapping/16903/1 "2014-04-09T18:31:42Z")

</div>

Hello,

I have an event timestamp in hive table which I'm breaking into  
evnt\_time(timestamp) and an evnt\_date(string) columns. The idea is to use  
the evnt\_time as timestamp in kibana and be able to search for date and  
stack one day on top of another in a histogram plot in kibana. Eventually  
giving me comparison between two days as a stacked chart.

As per elasticsearch-hive documentation, strings in hive will be of type  
string in elasticsearch also. However when I load data into elasticsearch  
the date column is being considered as timestamp.

How do I prevent this ? Please share if you have any ideas on how to get a  
stacked chart.

Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/37ebc775-09c1-4ccf-9063-18dc8b959c3d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/37ebc775-09c1-4ccf-9063-18dc8b959c3d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [April 9, 2014, 7:15pm UTC](https://discuss.elastic.co/t/elastic-search-hive-mapping/16903/2 "2014-04-09T19:15:48Z")

</div>

Hi,

Es-Hadoop doesn't perform strict mapping - it uses the Hive mapping to infer the JSON types used by the document which  
in turn are interpreted by Elasticsearch, which by default, will try to figure out the type of the data sent, in your  
case, a timestamp.  
The solution to this is create the mapping before hand in Elasticsearch - this gives you full control over what fields  
and types you want (not to mention indexing options,etc).  
This is discussed at length in the docs as well - see

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Cheers,

On 4/9/14 9:31 PM, P lva wrote:

> Hello,  
> I have an event timestamp in hive table which I'm breaking into evnt\_time(timestamp) and an evnt\_date(string) columns.  
> The idea is to use the evnt\_time as timestamp in kibana and be able to search for date and stack one day on top of  
> another in a histogram plot in kibana. Eventually giving me comparison between two days as a stacked chart.
> 
> As per elasticsearch-hive documentation, strings in hive will be of type string in elasticsearch also. However when I  
> load data into elasticsearch the date column is being considered as timestamp.
> 
> How do I prevent this ? Please share if you have any ideas on how to get a stacked chart.
> 
> Thanks
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/37ebc775-09c1-4ccf-9063-18dc8b959c3d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/37ebc775-09c1-4ccf-9063-18dc8b959c3d%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/37ebc775-09c1-4ccf-9063-18dc8b959c3d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/37ebc775-09c1-4ccf-9063-18dc8b959c3d%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Costin

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/53459C64.3020104%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/53459C64.3020104%40gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:37am UTC](https://discuss.elastic.co/t/elastic-search-hive-mapping/16903/3 "2017-07-06T01:37:07Z")

</div>


