For the complete documentation index, see llms.txt. This page is also available as Markdown.

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:

Processors
SQL Studio

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"
  }
}

Last updated

Was this helpful?