简体   繁体   English

为什么在 presto 中通过 st_distance 过滤请求失败?

[英]Why does request fail when filtered by st_distance in presto?

I try to filter by st_distance in my request, but presto failed saying that my latitude is not in the range (-90,90), without filter request it was working:我尝试在我的请求中通过st_distance进行过滤,但是 presto 失败了,说我的纬度不在范围内(-90,90),没有过滤请求它正在工作:

presto> SELECT id, id_type, lat, lon, ST_Distance(to_spherical_geography(ST_Point(lat, lon)), to_spherical_geography(ST_Point(59.988658, 30.200408))) 
       FROM geo.geo_data 
       WHERE ST_Distance(to_spherical_geography(ST_Point(lat, lon)), to_spherical_geography(ST_Point(59.988658, 30.200408))) < 500.0;

Query failed: Latitude must be between -90 and 90

You have some incorrect data in your table.您的表中有一些不正确的数据。 You can find it conveniently with using try() .您可以使用try()方便地找到它。

SELECT * 
FROM geo.geo_data
WHERE try(ST_Point(lat, lon)) IS NULL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM