H2ODB — Top Pickup Locations
H2ODB benchmark · all H2ODB queries
Top 10 pickup locations by trip count with WHERE IS NOT NULL
Representative SQL
Rendered for DataFusion with default parameters.
SELECT pickup_location_id, COUNT(*) AS trip_countFROM tripsWHERE pickup_location_id IS NOT NULLGROUP BY pickup_location_idORDER BY trip_count DESC, pickup_location_idLIMIT 10Representative DataFrame
Expression family (Polars, PySpark, DataFusion), default parameters.
def q10_expression_impl(ctx: DataFrameContext) -> Any: trips = ctx.get_table("trips") col = ctx.col return ( trips.filter(col("pickup_location_id").is_not_null()) .group_by("pickup_location_id") .agg(col("pickup_location_id").count().alias("trip_count")) .sort(["trip_count", "pickup_location_id"], descending=[True, False]) .limit(10) )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 H2ODB
bench = H2ODB(scale_factor=0.01) # your scale factorqueries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQLprint(queries['Q10'])For the DataFrame form:
from benchbox.core.query_catalog import get_dataframe_render
print(get_dataframe_render('h2odb', 'Q10', family="expression").source) # or family="pandas"Source
Query text: benchbox/core/h2odb/queries.py