TPC-DS-OBT Q89
TPC-DS-OBT benchmark · all TPC-DS-OBT queries
Representative SQL
Rendered for DataFusion with default parameters.
SELECT *FROM ( SELECT obt.item_i_category, obt.item_i_class, obt.item_i_brand, obt.store_s_store_name, obt.store_s_company_name, obt.sold_date_d_moy, SUM(obt.sales_price) AS sum_sales, AVG(SUM(obt.sales_price)) OVER ( PARTITION BY obt.item_i_category, obt.item_i_brand, obt.store_s_store_name, obt.store_s_company_name ) AS avg_monthly_sales FROM tpcds_sales_returns_obt AS obt WHERE ( obt.item_sk = obt.item_i_item_sk AND obt.sold_date_sk = obt.sold_date_d_date_sk AND obt.store_sk = obt.store_s_store_sk AND obt.sold_date_d_year IN (1998) AND ( ( obt.item_i_category IN ('0', '0', '0') AND obt.item_i_class IN ('0', '0', '0') ) OR ( obt.item_i_category IN ('0', '0', '0') AND obt.item_i_class IN ('0', '0', '0') ) ) ) AND channel = 'store' GROUP BY obt.item_i_category, obt.item_i_class, obt.item_i_brand, obt.store_s_store_name, obt.store_s_company_name, obt.sold_date_d_moy) AS tmp1WHERE CASE WHEN ( avg_monthly_sales <> 0 ) THEN ( CAST(ABS(sum_sales - avg_monthly_sales) AS DOUBLE PRECISION) / avg_monthly_sales ) ELSE NULL END > 0.1ORDER BY sum_sales - avg_monthly_sales, store_s_store_nameLIMIT 100Representative DataFrame
No DataFrame implementation is registered for this query.
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 TPCDSOBT
bench = TPCDSOBT(scale_factor=1.0) # your scale factorqueries = bench.get_queries(dialect="datafusion") # your platform's dialect; drop dialect= for native SQLprint(queries['89'])Source
Query text: benchbox/core/tpcds_obt/queries.py