Hi,
I have trouble with the timestamp format required for elasticsearch.
I have data in my hadoop that I want to load into ES.
My date field was first as this : "EEE, dd MMM yyyy HH:mm:ss Z"
I've transformed that with talend like this :
https://lh3.googleusercontent.com/-rzoBkk29LMM/VSzY7w4kSFI/AAAAAAAAAHA/Uq3XtZEdsyI/s1600/Capture.PNG
Now if I try to load my data into ES, it keeps on mapping it as a string
and not as a timestamp as it should be !
This is what I've done :
1)CREATE TABLE xx ( subject STRING, author string, sendingTime string)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t';
LOAD DATA INPATH '/user/hive/out.csv' OVERWRITE INTO TABLE mails;
2)CREATE EXTERNAL TABLE es_xx (subject string,author string, sendingTime
string)
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES('es.resource' = 'xx/xx',
'es.nodes'='xx',
'es.mapping.names' = 'date:@timestamp');
INSERT OVERWRITE TABLE es_xx SELECT s.subject, s.author, s.sendingTime
from xx s;
And this how it was mapped :
{"xx":{"mappings":{"xx":{"properties":{"author":{"type":"string"},"sendingtime":{"type":"string"},"subject":{"type":"string"}}}}}}
In another example I've transformed my date format like this yyyy-MM-ddTHH:mm:ssZ and that went good !
Is that the only format that ES accept? If so, that have to change !
What should I do to make ES recognize my date field as a timestamp?
If I do a static mapping and transform the sendingtime field into a timestamp, would it work? or the current format has to change?
Hope for a quick response, thanks you all,
best regards,
Omar,
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2bd9117a-38ba-4da1-a2e1-64462aa21486%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.