Skip to content

NYC Taxi — Zone Detail

NYC Taxi benchmark · all NYC Taxi queries

Detailed statistics for a specific zone

Representative SQL

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

SELECT
z.zone,
z.borough,
COUNT(*) AS pickup_count,
AVG(t.trip_distance) AS avg_distance,
AVG(t.total_amount) AS avg_fare,
SUM(t.total_amount) AS total_revenue
FROM trips AS t
JOIN taxi_zones AS z
ON t.pickup_location_id = z.location_id
WHERE
t.pickup_datetime >= '2019-01-02'
AND t.pickup_datetime < '2019-02-01'
AND t.pickup_location_id = 138
GROUP BY
z.zone,
z.borough

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['zone-detail'])

Source

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