Skip to content

NYC Taxi — Top Routes

NYC Taxi benchmark · all NYC Taxi queries

Most popular pickup-dropoff pairs

Representative SQL

Rendered in the benchmark’s native SQL with default parameters (no dialect translation available).

SELECT
t.pickup_location_id,
pz.zone AS pickup_zone,
t.dropoff_location_id,
dz.zone AS dropoff_zone,
COUNT(*) AS trip_count,
AVG(t.trip_distance) AS avg_distance,
AVG(t.total_amount) AS avg_fare
FROM trips AS t
LEFT JOIN taxi_zones AS pz
ON t.pickup_location_id = pz.location_id
LEFT JOIN taxi_zones AS dz
ON t.dropoff_location_id = dz.location_id
WHERE
t.pickup_datetime >= '2019-08-05' AND t.pickup_datetime < '2019-09-04'
GROUP BY
t.pickup_location_id,
pz.zone,
t.dropoff_location_id,
dz.zone
ORDER BY
trip_count DESC
LIMIT 50

Representative DataFrame

No DataFrame implementation is registered for this query.

Get the exact query for your run

The blocks above are representative. To get the precise statement a specific platform runs at a specific scale, substitute your own values:

from benchbox import NYCTaxi
bench = NYCTaxi(scale_factor=1.0) # your scale factor
queries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQL
print(queries['top-routes'])

Source

Query text: benchbox/core/nyctaxi/queries.py