# Hive date shows null in elasticsearch

**URL:** <https://discuss.elastic.co/t/hive-date-shows-null-in-elasticsearch/71069>\
**Category:** Elasticsearch\
**Created:** [January 10, 2017, 11:26am UTC](https://discuss.elastic.co/t/hive-date-shows-null-in-elasticsearch/71069 "2017-01-10T11:26:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![theebanparthi](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@theebanparthi](https://discuss.elastic.co/u/theebanparthi)\
**Post date:** [January 10, 2017, 11:26am UTC](https://discuss.elastic.co/t/hive-date-shows-null-in-elasticsearch/71069/1 "2017-01-10T11:26:08Z")

</div>

I have a hive table details with below schema

> name STRING,  
> address STRING,  
> dob DATE

My dob is stored in yyyy-mm-dd format.like 1988-01-27.

I am trying to load this Elasticsearch table . So i followed below instruction in HUE.

> CREATE EXTERNAL TABLE sampletable (name STRING, address STRING, dob DATE)  
> ROW FORMAT SERDE 'org.elasticsearch.hadoop.hive.EsSerDe'  
> STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler' TBLPROPERTIES('es.resource' = 'test4/test4','es.nodes' = 'x.x.x.x:9200');

> INSERT OVERWRITE TABLE sampletable SELECT \* FROM details;

> select \* from sample table;  
> But DOB field shows NULL for all coloumn. Whereas I can verify that my original hive table has data in date field.

After some research I was able to find that Elasticsearch expects data field to be in yyyy-mm-ddThh:mm:zz since my data doesn't match that it throws error. And also it mentioned, I can change the format to "strict\_date" format, then it will work fine my hive date format. But I am not sure where in hive query i execute I need to mention this. I mean I am not sure about the property I need to give a try.

I tired like

"TBLPROPERTIES('es.resource' = 'test4/test4','es.nodes' = 'x.x.x.x:9200','es.mapping.name' = 'dob:{"type":"date","format":"strict\_format"');

But it didnot work either  
Can some one help me with this?

---

<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 7, 2017, 11:26am UTC](https://discuss.elastic.co/t/hive-date-shows-null-in-elasticsearch/71069/2 "2017-02-07T11:26:46Z")

</div>

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