Skip to content

Read Primitives — Simple Limit

Read Primitives benchmark · all Read Primitives queries

Simple LIMIT without ORDER BY

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
*
FROM lineitem
ORDER BY
l_orderkey,
l_linenumber
LIMIT 100

Representative DataFrame

Expression family (Polars, PySpark, DataFusion), default parameters.

def limit_expression_impl(ctx: DataFrameContext) -> Any:
return ctx.get_table("lineitem").sort(["l_orderkey", "l_linenumber"]).limit(100)

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 ReadPrimitives
bench = ReadPrimitives(scale_factor=0.01) # your scale factor
queries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQL
print(queries['limit'])

For the DataFrame form:

from benchbox.core.query_catalog import get_dataframe_render
print(get_dataframe_render('read_primitives', 'limit', family="expression").source) # or family="pandas"

Source

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