Skip to content

Read Primitives — Decimal Non-Selective Filter

Read Primitives benchmark · all Read Primitives queries

Range predicate on decimal column with low selectivity

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
COUNT(*)
FROM lineitem
WHERE
l_extendedprice > 1000.00

Representative DataFrame

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

def expression_impl(ctx: DataFrameContext) -> Any:
table = ctx.get_table(table_name)
return table.filter(_expr_count_filter_predicate(ctx, column_name, op, value, lower)).select(
ctx.col(count_col).count().alias(alias)
)

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

For the DataFrame form:

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

Source

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