Skip to content

NYC Taxi — Fare Distribution

NYC Taxi benchmark · all NYC Taxi queries

Distribution of fare amounts

Representative SQL

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

SELECT
FLOOR(fare_amount / 5) * 5 AS fare_bucket,
COUNT(*) AS trip_count,
AVG(trip_distance) AS avg_distance,
AVG(tip_amount) AS avg_tip
FROM trips
WHERE
pickup_datetime >= '2019-07-31'
AND pickup_datetime < '2019-08-30'
AND fare_amount BETWEEN 0 AND 100
GROUP BY
FLOOR(fare_amount / 5) * 5
ORDER BY
fare_bucket

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['fare-distribution'])

Source

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