NYC Taxi — Tip Analysis
NYC Taxi benchmark · all NYC Taxi queries
Tip patterns by time and location
Representative SQL
Rendered for DataFusion with default parameters.
SELECT EXTRACT(HOUR FROM pickup_datetime) AS hour, COUNT(*) AS trip_count, AVG(tip_amount) AS avg_tip, AVG( CASE WHEN fare_amount > 0 THEN CAST(tip_amount AS DOUBLE PRECISION) / fare_amount * 100 END ) AS avg_tip_pctFROM tripsWHERE pickup_datetime >= '2019-10-24' AND pickup_datetime < '2019-11-23' AND payment_type = 1GROUP BY EXTRACT(HOUR FROM pickup_datetime)ORDER BY hourRepresentative 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 factorqueries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQLprint(queries['tip-analysis'])Source
Query text: benchbox/core/nyctaxi/queries.py