Skip to content

TPC-DS Q55 — Brand Manager Sales

TPC-DS benchmark · all TPC-DS queries

Reports brand sales for items managed by a specific manager

Representative SQL

Rendered for DataFusion with default parameters.

SELECT
i_brand_id AS brand_id,
i_brand AS brand,
SUM(ss_ext_sales_price) AS ext_price
FROM date_dim, store_sales, item
WHERE
d_date_sk = ss_sold_date_sk
AND ss_item_sk = i_item_sk
AND i_manager_id = 36
AND d_moy = 12
AND d_year = 2001
GROUP BY
i_brand,
i_brand_id
ORDER BY
ext_price DESC,
i_brand_id
LIMIT 100

Representative DataFrame

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

def impl(ctx: DataFrameContext) -> Any:
return helper(ctx, query_id, *helper_args)

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

Parameter substitution for this benchmark is seed-driven; pass a seed for a specific stream’s parameters:

print(bench.get_query(55, scale_factor=1.0, seed=42, dialect="datafusion"))

For the DataFrame form:

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

Source

Query text: _sources/tpc-ds/query_templates/query55.tpl