Convert field type String to geo_point

(Olalekan Elesin) #1

I use es_hadoop_hive to save data into elasticsearch. But I have a field which I formatted as string in hive but the mapping is geo_point in ES. How can save the data such that the mapping auto generated by hive does not override the geo_point mapping already created?
Or is there a way to convert a field type from String to Geo_point when visualizing in Kibana?

(Mark Walkom) #2

It won't over write what is in ES. Is that what you are seeing?

No, you need to map it correctly in ES.

(Olalekan Elesin) #3

I did the mapping correctly in ES but anytime I insert into the Hive table that connects to ES, another type is created with the field name as the same but fieldtype as string.

(Mark Walkom) #4

Maybe if you post your mappings we can comment further.

(ChAkO) #5

I have the same problem
I need to convert a string coordinates to geo_point type to visualize in kibana correctly.
I've tried to convert this field in the hive script, it's possible?

CREATE EXTERNAL TABLE hive_to_es_table
id string,
geo_coordinates string
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES('es.resource' = 'my_index/my_type',
'' = 'id',
'es.mapping.names' = 'geo_coordinates:@geo_point',
'es.nodes' = 'minode.corp');

I have not gotten it.
Can anybody help me?

(Mark Walkom) #6

You should start your own thread over in the Hadoop category :slight_smile:

(system) #7