DISTANCE
This page describes the DISTANCE function in Lenses SQL.
DISTANCE(x1,y1,x2,y2)
Calculates the distance between two points using the haversine method.
Available in:
Sample code:
USE `kafka`;
SELECT
DISTANCE(pickup_latitude, pickup_longitude, dropoff_latitude, dropoff_longitude)
FROM nyc-yellow-taxi-trip
LIMIT 1;
Output:
{
"value": {
"DISTANCE": "8579.658400770431"
}
}