TPC-DS Q26 — Catalog Sales Promo Analysis
TPC-DS benchmark · all TPC-DS queries
Reports catalog sales promotion effectiveness
Representative SQL
Rendered for DataFusion with default parameters.
SELECT i_item_id, AVG(cs_quantity) AS agg1, AVG(cs_list_price) AS agg2, AVG(cs_coupon_amt) AS agg3, AVG(cs_sales_price) AS agg4FROM catalog_sales, customer_demographics, date_dim, item, promotionWHERE cs_sold_date_sk = d_date_sk AND cs_item_sk = i_item_sk AND cs_bill_cdemo_sk = cd_demo_sk AND cs_promo_sk = p_promo_sk AND cd_gender = 'F' AND cd_marital_status = 'W' AND cd_education_status = 'Primary' AND ( p_channel_email = 'N' OR p_channel_event = 'N' ) AND d_year = 1998GROUP BY i_item_idORDER BY i_item_idLIMIT 100Representative 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 factorqueries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQLprint(queries['26'])Parameter substitution for this benchmark is seed-driven; pass a seed for a specific stream’s parameters:
print(bench.get_query(26, 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', '26', family="expression").source) # or family="pandas"Source
Query text: _sources/tpc-ds/query_templates/query26.tpl