怎么又是你

Spark读取ES地理位置字段出错

Elasticsearch | 作者 moran | 发布于2016年12月12日 | 阅读数:8843

Mapping定义如下:"geoip"  : {
     "type" : "object",
     "dynamic": true,
     "properties" : {
          "province_name": { "type": "string","index": "not_analyzed", "doc_values" : true },
         "city_name" : { "type" : "string","index": "not_analyzed", "doc_values" : true },
         "location" : { "type" : "geo_point", "doc_values" : true }
        }
}
Spark读取时报错:
Caused by: org.elasticsearch.hadoop.rest.EsHadoopInvalidRequest: Found unrecoverable error [XXXXX:9200] returned Bad Request(400) - failed to parse;illegal latitude value [269.83022689819336] for geoip.location; Bailing out..
    at org.elasticsearch.hadoop.rest.RestClient.retryFailedEntries(RestClient.java:207)
    at org.elasticsearch.hadoop.rest.RestClient.bulk(RestClient.java:170)
    at org.elasticsearch.hadoop.rest.RestRepository.tryFlush(RestRepository.java:225)
    at org.elasticsearch.hadoop.rest.RestRepository.flush(RestRepository.java:248)
    at org.elasticsearch.hadoop.rest.RestRepository.doWriteToIndex(RestRepository.java:201)
    at org.elasticsearch.hadoop.rest.RestRepository.writeToIndex(RestRepository.java:163)
    at org.elasticsearch.spark.rdd.EsRDDWriter.write(EsRDDWriter.scala:49)
    at org.elasticsearch.spark.rdd.EsSpark$$anonfun$saveToEs$1.apply(EsSpark.scala:67)
    at org.elasticsearch.spark.rdd.EsSpark$$anonfun$saveToEs$1.apply(EsSpark.scala:67)
    at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:66)
    at org.apache.spark.scheduler.Task.run(Task.scala:89)
    at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:214)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
 
请问这个怎么解决?
已邀请:

y676360

赞同来自:

地理位置latitude取值269.83022689819336,也就是维度的取值超过正常的取值了吧,lat的取值好像是 0到+-90

coyotey - 地理信息大数据解决方案

赞同来自:

经度-180 — + 180
纬度-90 — + 90

要回复问题请先登录注册