# How can I map an empty string field with the geo-point type?

**URL:** <https://discuss.elastic.co/t/how-can-i-map-an-empty-string-field-with-the-geo-point-type/36852>\
**Category:** Elasticsearch\
**Created:** [December 10, 2015, 9:29am UTC](https://discuss.elastic.co/t/how-can-i-map-an-empty-string-field-with-the-geo-point-type/36852 "2015-12-10T09:29:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![miracle24](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@miracle24](https://discuss.elastic.co/u/miracle24)\
**Post date:** [December 10, 2015, 9:29am UTC](https://discuss.elastic.co/t/how-can-i-map-an-empty-string-field-with-the-geo-point-type/36852/1 "2015-12-10T09:29:56Z")

</div>

Hello, I use the elasticsearch-jdbc to import data from mysql to ES.here is my shell command:  
`echo ' { "type" : "jdbc", "jdbc" : { "url" : "jdbc:mysql://localhost:3306/test", "user" : "", "password" : "", "locale" : "en_US", "sql" : "select \"world\" as _index, \"city\" as _type, name as _id, city, zip, address, lat as \"location.lat\", lon as \"location.lon\" from geo", "elasticsearch" : { "cluster" : "elasticsearch", "host" : "localhost", "port" : 9300 }, "index" : "world", "type" : "city", "index_settings" : { "index" : { "number_of_shards" : 1 } }, "type_mapping": { "city" : { "properties" : { "location" : { "type" : "geo_point" } } } } } } ' | java \ -cp "${lib}/*" \ -Dlog4j.configurationFile=${bin}/log4j2.xml \ org.xbib.tools.Runner \ org.xbib.tools.JDBCImporter`

In mysql database,the field "lat" and "lon" are string type(Don't ask me why), so when I run the above command, I got this:  
`Caused by: java.lang.NumberFormatException: empty String at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1842) at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110) at java.lang.Double.parseDouble(Double.java:538) at org.elasticsearch.common.xcontent.support.AbstractXContentParser.doubleValue(AbstractXContentParser.java:182) at org.elasticsearch.common.geo.GeoUtils.parseGeoPoint(GeoUtils.java:368) at org.elasticsearch.index.mapper.geo.GeoPointFieldMapper.parse(GeoPointFieldMapper.java:671) at org.elasticsearch.index.mapper.DocumentParser.parseObjectOrField(DocumentParser.java:314) at org.elasticsearch.index.mapper.DocumentParser.parseObject(DocumentParser.java:331) at org.elasticsearch.index.mapper.DocumentParser.parseObject(DocumentParser.java:257) at org.elasticsearch.index.mapper.DocumentParser.innerParseDocument(DocumentParser.java:127)`

I know the reason.The data of field "lat" and "lon" is empty in database and when the ES tried to map it with the geo\_point type as I required, the exception would happen.  
So,how can solve this "empty string field mapping to geo\_point type" problem?Can somebody give advice?  
Thanks a lot!

---

<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 5, 2017, 11:32pm UTC](https://discuss.elastic.co/t/how-can-i-map-an-empty-string-field-with-the-geo-point-type/36852/2 "2017-07-05T23:32:05Z")

</div>


