# String being converted to date in Hadoop-Es Java map reduce job

**URL:** <https://discuss.elastic.co/t/string-being-converted-to-date-in-hadoop-es-java-map-reduce-job/58531>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [August 21, 2016, 10:58am UTC](https://discuss.elastic.co/t/string-being-converted-to-date-in-hadoop-es-java-map-reduce-job/58531 "2016-08-21T10:58:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_she](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_she/32/48792_2.png) [@David\_she](https://discuss.elastic.co/u/David_she)\
**Post date:** [August 21, 2016, 10:58am UTC](https://discuss.elastic.co/t/string-being-converted-to-date-in-hadoop-es-java-map-reduce-job/58531/1 "2016-08-21T10:58:50Z")

</div>

I'm trying to load via a mapreduce job in Java using Hadoop-Es. The issue is it tries to load it as a date but I want a string "yyyy-MM-dd". Any idea? I tried a date but it converts to a different format

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [March 31, 2017, 6:18pm UTC](https://discuss.elastic.co/t/string-being-converted-to-date-in-hadoop-es-java-map-reduce-job/58531/2 "2017-03-31T18:18:25Z")

</div>

ES will dynamically create the field type it think best suits the value. Since YYYY-MM-dd you're using is a date, it will automatically create a type date. If you want to use "string", you will have to manually create the ES mapping yourself first.

---

<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:22pm UTC](https://discuss.elastic.co/t/string-being-converted-to-date-in-hadoop-es-java-map-reduce-job/58531/3 "2017-07-06T13:22:17Z")

</div>


