ClickBench — Search Phrase Compound Sort
ClickBench benchmark · all ClickBench queries
Non-empty search phrases with compound sort (EventTime, SearchPhrase)
Representative SQL
Rendered for DataFusion with default parameters.
SELECT SearchPhraseFROM hitsWHERE SearchPhrase <> ''ORDER BY EventTime, SearchPhraseLIMIT 10Representative DataFrame
Expression family (Polars, PySpark, DataFusion), default parameters.
def impl(ctx: DataFrameContext) -> Any: result = _expr_filter(ctx, _hits(ctx), filter_code) if sort_spec: sort_cols, descending = _sort_parts(sort_spec) result = result.sort(sort_cols, descending=descending) if limit_spec: result = result.limit(int(limit_spec)) return result.select(*select_spec.split(",")) if select_spec else resultGet 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 ClickBench
bench = ClickBench(scale_factor=1.0) # your scale factorqueries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQLprint(queries['Q27'])For the DataFrame form:
from benchbox.core.query_catalog import get_dataframe_render
print(get_dataframe_render('clickbench', 'Q27', family="expression").source) # or family="pandas"Source
Query text: benchbox/core/clickbench/queries.py